thoughts on the source

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

I don't have a MSVC compiler so I can't do much until someone more knowledgeable than I puts forth a makefile I can use, but there are some things I'd like to look at. This is sort of a publicly visible notes file.

In CBaseShipAI.cpp at line 350 there's a destiny check in the flocking code. Why? Doesn't making flocking only apply to a random subset of ships defeat the purpose? I'd like to experiment with defining that if out for an if (TRUE).

At line 1650 in the same file there begins void cbaseshipai::useitemsbehavior(void). This is legacy code that handles superconducting shields. Why not move this to an <OnAIUpdate> event on the superconducting shield and remove this?

In TSEShipControllersImpl.h all derived classes of CBaseShipAI seem to have CSpaceObject *m_pTarget, which seems to represent the AI's target. If this were moved to the base class, along with possibly similar internal AI variables like CSpaceObject *m_pDest I think they could be made accessible in script. This is functionality I need for intelligent AI behavior with triggered fragmentation weapons.
Literally is the new Figuratively
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Nice observations; glad you're finding your way around the code.

1. Flocking code: I'd love to experiment with that too. I'm sure I did it original for performance, but I don't know if the difference is noticeable (either in flocking or in performance).

2. UseItemsBehavior: Yes, absolutely, this is legacy code but I haven't had time to move it.

3. m_pTarget in CBaseShipAI: I agree with this; but it is slightly tricky to do properly because you have to deal with old save files (for old save files the derrived classes would still have to load the variable and set it in the base class). In any case, I think m_pTarget is accessible in script already (objGetTarget).

p.s.: You probably know that there is a free version of Microsoft Visual Studio. I believe it will work to compile the code.
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

george moromisato wrote:p.s.: You probably know that there is a free version of Microsoft Visual Studio. I believe it will work to compile the code.
Actually I didn't. I'll have to hunt that down.
Literally is the new Figuratively
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Atarlost wrote:
george moromisato wrote:p.s.: You probably know that there is a free version of Microsoft Visual Studio. I believe it will work to compile the code.
Actually I didn't. I'll have to hunt that down.
Try this:

http://www.microsoft.com/visualstudio/e ... pp-express

This is a later version than what I'm using, but it should work.
User avatar
Aury
Fleet Admiral
Fleet Admiral
Posts: 5526
Joined: Tue Feb 05, 2008 1:10 am
Location: At the VSS Shipyards in the frontier, designing new ships.

There are some necessary tweaks to get it almost compiling. I'm currently just missing george's TSUI.lib, but I managed to get it working up to that point without errors. (You need to uninstall any VC++ runtimes you have installed, then install DXSDK 2007, then DXSDK 2010, then take ddraw.lib and dxguid.lib from them respectively both into the VC++ EE's libraries folder, since otherwise it just derps up and fails to recognize them, even if you tell it to look in those directories. (Though that *might* have been due to my weird directory structure that I created in order to minimize most issues of moving over to my SSD) - you will also need to overwrite the IntelJPEGUtil folder from yesterday's version of the repository entirely with the folder from today's. I don't know why you can't just insert that one new file, but it failed every time I tried to build it that way. Lastly, you need to change a single line in the Transcendence.rc file with a text editor. There some reference to a header file that starts with an a and is 6 chars long (excluding extension) which is not included in the express editions, but you can apparently change it to windows.h safely instead))
(shpOrder gPlayership 'barrelRoll)

<New tutorials, modding resources, and official extension stuff coming to this space soon!>
Post Reply