HOWTO: Compile the Engine

Discussion in 'ToEE Engine Recreation Project' started by DarkStorm, Sep 27, 2009.

Remove all ads!
  1. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    I wrote a short HOWTO that explains how the Engine can be compiled:

    http://toee.hartte.de/trac/wiki/HowToCompile

    In short: You only need a few free tools and are ready to go.

    If you have any problems with this description, please let me know.

    Cu,
    Storm
     
  2. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Hi, can you update this? There are a lot more files now, it's quite confusing.
     
  3. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    Thanks for the reminder, I will do that.

    Do you have any specific problems I should elaborate on?

    Cu,
    Storm
     
  4. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Well, first off, it seems that the latest build uses some art assets that don't exist in the repository (or in my HD for that matter).
    e.g.:
    Code:
    "Error    4    Could not find a part of the path 'C:\Users\שי\AppData\Local\EvilTemple\art\interface\utility_bar_ui\background.png'.    C:\ToEE\Modding\Evil Temple\Engine\GUI\UtilityBar.xaml    8    45    Engine
    )
    That's when I try to 'debug'. The above does seem to correspond with ToEE's art assets, except it points to .png rather than .tga. I could go through all the game files and convert each one, but that would be rather painstaking. How can this be addressed?
    edit: Downloaded FastStone image viewer/editor, supports batch image conversion - free and highly recommended!
    Ok, now that the images are in place, it alerted me to the absence of prototypes.xml in the Local\Temp folder.
    After I manually copied it there, I got a new exception:

    Code:
    System.NotImplementedException was unhandled
      Message="השיטה או הפעולה אינן מיושמות."
      Source="EvilTemple.GameRules"
      StackTrace:
           ב-  EvilTemple.GameRules.Prototype.ObjectPrototype.ProcessEffects(XmlElement element) ב- C:\ToEE\Modding\Evil Temple\RuleSet\Prototype\ObjectPrototype.cs:שורה 219
           ב-  EvilTemple.GameRules.Prototype.ObjectPrototype.ProcessElement(XmlElement element) ב- C:\ToEE\Modding\Evil Temple\RuleSet\Prototype\ObjectPrototype.cs:שורה 175
           ב-  EvilTemple.GameRules.Prototype.ItemPrototype.ProcessElement(XmlElement element) ב- C:\ToEE\Modding\Evil Temple\RuleSet\Prototype\ItemPrototype.cs:שורה 33
           ב-  EvilTemple.GameRules.Prototype.ObjectPrototype.Load(XmlElement element) ב- C:\ToEE\Modding\Evil Temple\RuleSet\Prototype\ObjectPrototype.cs:שורה 146
           ב-  EvilTemle.ResourcePreprocessor.InterfacePreprocessor.Preprocess(String outputPath) ב- C:\ToEE\Modding\Evil Temple\ResourcePreprocessor\InterfacePreprocessor.cs:שורה 49
           ב-  EvilTemple.NewGame.Run(MainWindow mainWindow, GraphicsSettings settings) ב- C:\ToEE\Modding\Evil Temple\Engine\NewGame.cs:שורה 291
           ב-  EvilTemple.Engine.App.OnStartup(Object sender, StartupEventArgs e) ב- C:\ToEE\Modding\Evil Temple\Engine\App.xaml.cs:שורה 48
           ב-  System.Windows.Application.OnStartup(StartupEventArgs e)
           ב-  System.Windows.Application.<.ctor>b__0(Object unused)
           ב-  System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
           ב-  System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
           ב-  System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
           ב-  System.Windows.Threading.DispatcherOperation.InvokeImpl()
           ב-  System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
           ב-  System.Threading.ExecutionContext.runTryCode(Object userData)
           ב-  System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
           ב-  System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
           ב-  System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           ב-  System.Windows.Threading.DispatcherOperation.Invoke()
           ב-  System.Windows.Threading.Dispatcher.ProcessQueue()
           ב-  System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
           ב-  MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
           ב-  MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
           ב-  System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
           ב-  System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
           ב-  System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
           ב-  System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
           ב-  System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
           ב-  MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
           ב-  MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
           ב-  System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
           ב-  System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
           ב-  System.Windows.Threading.Dispatcher.Run()
           ב-  System.Windows.Application.RunDispatcher(Object ignore)
           ב-  System.Windows.Application.RunInternal(Window window)
           ב-  System.Windows.Application.Run(Window window)
           ב-  System.Windows.Application.Run()
           ב-  EvilTemple.Engine.App.Main() ב- C:\ToEE\Modding\Evil Temple\Engine\obj\Debug\App.g.cs:שורה 0
           ב-  System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
           ב-  System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
           ב-  System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
           ב-  System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
           ב-  System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
           ב-  System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
           ב-  System.Activator.CreateInstance(ActivationContext activationContext)
           ב-  Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
           ב-  System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           ב-  System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           ב-  System.Threading.ThreadHelper.ThreadStart()
      InnerException: 
    
    I'm guessing that means a bunch of other files / definitions are missing, but this time I have no idea what exactly. Anyway, I'm guessing all of this can be easily fixed somehow, since I doubt you have to go through all of that yourself.

    As for when I try to compile (Build Solution, F6, etc.) it seems to create a bunch of files where the source is. Not sure if I'm even supposed to run those, and at any rate, the application immediately closes anyway.

    Those are the problems I've run into for now.
     
    Last edited: Nov 7, 2009
  5. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    Ah yes,

    here's how it's supposed to work in the future (and already does, I don't know why exactly it didn't work for you):

    There is this ResourcePreprocessor project in the solution, it's responsible for converting all the neccessary TGA's into PNG's in %APPDATA%\Local\EvilTemple folder. It also merges those split images (dialog backgrounds, i.e. art/interface/alert/alert_background.png). The prototype.xml is also created at the start of the program automatically.

    I'll try to find out why this didn't work for you.

    Cu,
    Storm

    ps: The stack trace you posted should be fixed in the current version (just update your local source folder). I checked in broken code... sorry :/
     
    Last edited: Nov 7, 2009
  6. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Where does it look for the resources? The DAT files in the main ToEE folder?

    Also, updated to v159: Now it says "The requested value 'OWF_TWO_HANDED' not found".

    Code:
    System.ArgumentException was unhandled
      Message="הערך המבוקש 'OWF_TWO_HANDED' לא נמצא."
      Source="mscorlib"
      StackTrace:
           ב-  System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
           ב-  System.Enum.Parse(Type enumType, String value)
           ב-  EvilTemple.GameRules.Prototype.ObjectPrototype.ConvertValue(String value, Type type) ב- C:\ToEE\Modding\Evil Temple\RuleSet\Prototype\ObjectPrototype.cs:שורה 286
           ב-  EvilTemple.GameRules.Prototype.ObjectPrototype.ConvertValue[T](String value) ב- C:\ToEE\Modding\Evil Temple\RuleSet\Prototype\ObjectPrototype.cs:שורה 276
           ב-  EvilTemple.GameRules.Prototype.ObjectPrototype.ConvertFlagList[T](XmlElement flagList, Action`1 callback) ב- C:\ToEE\Modding\Evil Temple\RuleSet\Prototype\ObjectPrototype.cs:שורה 164
           ב-  EvilTemple.GameRules.Prototype.WeaponPrototype.ProcessElement(XmlElement element) ב- C:\ToEE\Modding\Evil Temple\RuleSet\Prototype\WeaponPrototype.cs:שורה 40
           ב-  EvilTemple.GameRules.Prototype.ObjectPrototype.Load(XmlElement element) ב- C:\ToEE\Modding\Evil Temple\RuleSet\Prototype\ObjectPrototype.cs:שורה 149
           ב-  EvilTemle.ResourcePreprocessor.InterfacePreprocessor.Preprocess(String outputPath) ב- C:\ToEE\Modding\Evil Temple\ResourcePreprocessor\InterfacePreprocessor.cs:שורה 49
           ב-  EvilTemple.NewGame.Run(MainWindow mainWindow, GraphicsSettings settings) ב- C:\ToEE\Modding\Evil Temple\Engine\NewGame.cs:שורה 291
           ב-  EvilTemple.Engine.App.OnStartup(Object sender, StartupEventArgs e) ב- C:\ToEE\Modding\Evil Temple\Engine\App.xaml.cs:שורה 48
           ב-  System.Windows.Application.OnStartup(StartupEventArgs e)
           ב-  System.Windows.Application.<.ctor>b__0(Object unused)
           ב-  System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
           ב-  System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
           ב-  System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
           ב-  System.Windows.Threading.DispatcherOperation.InvokeImpl()
           ב-  System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
           ב-  System.Threading.ExecutionContext.runTryCode(Object userData)
           ב-  System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
           ב-  System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
           ב-  System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           ב-  System.Windows.Threading.DispatcherOperation.Invoke()
           ב-  System.Windows.Threading.Dispatcher.ProcessQueue()
           ב-  System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
           ב-  MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
           ב-  MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
           ב-  System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
           ב-  System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
           ב-  System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
           ב-  System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
           ב-  System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
           ב-  MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
           ב-  MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
           ב-  System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
           ב-  System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
           ב-  System.Windows.Threading.Dispatcher.Run()
           ב-  System.Windows.Application.RunDispatcher(Object ignore)
           ב-  System.Windows.Application.RunInternal(Window window)
           ב-  System.Windows.Application.Run(Window window)
           ב-  System.Windows.Application.Run()
           ב-  EvilTemple.Engine.App.Main() ב- C:\ToEE\Modding\Evil Temple\Engine\obj\Debug\App.g.cs:שורה 0
           ב-  System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
           ב-  System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
           ב-  System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
           ב-  System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
           ב-  System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
           ב-  System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
           ב-  System.Activator.CreateInstance(ActivationContext activationContext)
           ב-  Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
           ב-  System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           ב-  System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           ב-  System.Threading.ThreadHelper.ThreadStart()
      InnerException: 
    
     
    Last edited: Nov 7, 2009
  7. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    It searches your registry for the location of your ToEE installation. It doesn't use the data/ folder yet, however (for performance reasons).

    I comitted a working version (rev 161) and will stop comitting until i finished the object system.

    Cu,
    Storm
     
  8. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    Did some debugging:


    1. The startup object is EvilTemple.Engine.App.
    2. The constructor method instantiates a NewGame class.
    3. NewGame instantiates a World class.
    4. World instantiates UtilityBar.
    5. UtilityBar invokes UtilityBar.xaml, some of whose buttons use the missing PNGs.
    6. Only later is OnStartup invoked, which is where the Run() method, and subsequently ResourceManager, are invoked.

    I'm guessing you didn't notice that because all the files are already in place in your computer. Try renaming the Local\EvilTemple\art folder to 'arte' and see what happens.
     
  9. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    I guess you are right on that. I changed the initialization part of the game after I already had all the files generated. I'll fix that bug while I am working on fixing the architecture in that part of the engine. The goal is to separate all the game logic and d20 rules from the graphics engine and gui.

    Cu,
    Storm
     
  10. TheLadiesOgre

    TheLadiesOgre Member

    Joined:
    Dec 15, 2008
    Messages:
    47
    Likes Received:
    0
    Please tell me that all of the "System.Windows.Threading" in the stack trace posted above is an indication that you're designing the engine to support multithreading... if so :joy:
     
  11. DarkStorm

    DarkStorm Established Member

    Joined:
    Oct 2, 2003
    Messages:
    514
    Likes Received:
    3
    No it's not... I don't really see why a game that could've run perfectly fine in 2003 needs a multicore cpu now ;-)
     
  12. Vegimite

    Vegimite Member

    Joined:
    Dec 5, 2009
    Messages:
    1
    Likes Received:
    0
    I am interested in helping with this project.

    I had a problem executing the code : You are using SHGetKnownFolderPath this is a problem as I am running XP and this dll entry point is supported in Vista and not XP. Only SHGetFolderPath is available in XP.
     
Our Host!