Jump to content

Logo

Photo

ExportDLLs

ExportDLL

  • Please log in to reply
29 replies to this topic

#1 TonyE

TonyE

    Advanced Member

  • Staff Pukes
  • PipPipPip
  • 3,351 posts

Posted 29 September 2007 - 10:47 AM

HCE has, as of version 2007.022 the ability to send some game data out to external DLLs. I'll work up documentation as able. As implemented in 2007.022 every piece of data that AGSI allows us to export is being exported. We'll work with AGSI to increase the exported data items (for instance, number of missiles or planes in a unit would be nice, weapon launch events would be nice, etc.).

The DLL files will live in C:\Matrix Games\HCE\ExportDLLs\ in a default installation.

To disable a DLL, rename it so that the file extension is not .DLL, i.e. rename DataDump1.dll to DataDump1.dll.bak to turn it off.

The DLLs will slow the game somewhat depending upon how much processing each one does, some of them like DataDump1.dll make large files.

The DLLs also throw their errors back to the GE, so if there are bugs in the DLL, it will crash your game. This was common in my first generation of DLLs.

I have yet to optimize the GE for this process to reduce the amount of data sent and will do that as time permits.

Data exported by the DLL Interface in 2007.022 (version 1 of export specification):
// Functions to send the data to DLL
void dllexUnitLatLon(UnitPtr Uptr); (Position in decimal lat/lon of each unit)
void dllexUnitShowing(UnitPtr Uptr); (Visibility of each unit as viewed from each side)
void dllexUnitURegion(UnitPtr Uptr); (Uncertainty regions of each unit as viewed from each side)
void dllexUnitCourse(UnitPtr Uptr); (Unit heading in degrees)
void dllexUnitSpeed(UnitPtr Uptr); (Unit speed in knots)
void dllexUnitAlt(UnitPtr Uptr); (Unit altitude band)
void dllexUnitShowingSide(UnitPtr Uptr); (Unit side as viewed by each side)
void dllexUnitSink(UnitPtr Uptr); (Unit is sinking)
void dllexGameTime(long GTime); (Current game time starts at 10,000 and increments in seconds)
void dllexMsgLog(char *MsgLine); (Message Log line)
void dllexUnitToGroup(UnitPtr Uptr, GroupPtr GroupOld); (Unit changing from old group to new)
void dllexUnitNew(UnitPtr Uptr); (New unit, i.e. plane launched, missile, etc.)
void dllexUnitFree(UnitPtr Uptr); (Unit freed, leaves map)
void dllexScenLoad(void); (New scenario/save loaded, report info to DLL)

I should note in case anyone is into programming and wants to get right to writing a DLL, holler and I'll help, but more importantly the version 1 specification isn't set in stone yet for what data is exported and how it is exported.



#2 TonyE

TonyE

    Advanced Member

  • Staff Pukes
  • PipPipPip
  • 3,351 posts

Posted 29 September 2007 - 10:54 AM

DataDump1.dll version 2, interface version 1, for GE 2007.022

Writes all of the exported data to HC directory in a file named datadump.txt which is over-written each time the game is loaded.

WARNING: The text files can get very large!

Installation:
Extract ZIP with directories in tact to your HC directory, the DataDump1.dll will end up in an ExportDLLs directory.

Attached Files


Edited by TonyE, 16 July 2008 - 03:36 PM.
version 3 replacing v2 on 2008/07/16


#3 TonyE

TonyE

    Advanced Member

  • Staff Pukes
  • PipPipPip
  • 3,351 posts

Posted 29 September 2007 - 10:57 AM

GoogleEarth.dll version 1, interface version 1, for GE 2007.022

Runs a tiny webserver that serves a kml file to GoogleEarth on port 8180 to the local machine.

Installation:
Extract ZIP with directories in tact to your HC directory, the GoogleEarth.dll will end up in an ExportDLLs directory and a GoogleEarth directory will be created with each unit icon separated into its own file. See the Word document in the ZIP file for further instructions.

Attached Files



#4 TonyE

TonyE

    Advanced Member

  • Staff Pukes
  • PipPipPip
  • 3,351 posts

Posted 08 July 2008 - 02:33 PM

Delphi Source Code for the DataDump DLL

Attached Files


Edited by TonyE, 16 July 2008 - 03:41 PM.
updated 2008/07/16 cdecl instead of stdcall


#5 TEPonta

TEPonta

    Advanced Member

  • Members
  • PipPipPip
  • 577 posts

Posted 08 July 2008 - 03:56 PM

Tony,

A work of pure genius, thanx. I can see getting alot of fun out of this one.

Buddha

#6 Akula

Akula

    Advanced Member

  • HC3Posters
  • PipPipPip
  • 403 posts

Posted 10 July 2008 - 01:14 PM

In very simple terms that I can understand, what exactly is the purpose of this?

Is it to be used like a debugging tool that gives you info you need to track down an error?

#7 noxious

noxious

    Advanced Member

  • Members
  • PipPipPip
  • 158 posts

Posted 10 July 2008 - 01:46 PM

In very simple terms that I can understand, what exactly is the purpose of this?

Is it to be used like a debugging tool that gives you info you need to track down an error?


No, it's the beginning of an external API allowing us to write "plug-ins" to complement, or maybe eventually override stock behavior.
It's a toy for programmers to bring new toys to the players and designers alike :)

#8 Akula

Akula

    Advanced Member

  • HC3Posters
  • PipPipPip
  • 403 posts

Posted 11 July 2008 - 09:27 PM

In very simple terms that I can understand, what exactly is the purpose of this?

Is it to be used like a debugging tool that gives you info you need to track down an error?


No, it's the beginning of an external API allowing us to write "plug-ins" to complement, or maybe eventually override stock behavior.
It's a toy for programmers to bring new toys to the players and designers alike :)


Ok. So its a way to add player made mods, in simplistic terms. Gotcha.

Keep in mind my programming skill is like a -1000. So some things I really don't understand.

#9 TEPonta

TEPonta

    Advanced Member

  • Members
  • PipPipPip
  • 577 posts

Posted 12 July 2008 - 12:22 AM

Speaking as non-programmer who plays Harpoon simply for enjoyment, I think it adds to the fun. It also might be helpful in Scenario design.

Buddha

#10 TonyE

TonyE

    Advanced Member

  • Staff Pukes
  • PipPipPip
  • 3,351 posts

Posted 20 September 2008 - 10:45 PM

Okay, got a new one I'm hoping you guys can test for stability. It is a precursor to hopefully replacing the Unit window. The file is attached, unzip to your ExportDLLs folder. When you run the game this DLL will throw up a window with a button to show you information about the units visible in the Unit window (at present it only has information for exactly localized units). It also makes a text file in your HC directory called "hcunitwin.txt".

Yes, I do know it is annoying that it stays on top of the other windows...

Anyway, I'm looking for feedback on whether it crashes your game or causes any other big hardships. It will slow your game down somewhat. The log files aren't too huge so I don't think they'll run you out of space or anything.

Must be used with GE 2008.053 (or newer?).

<attachment removed>

#11 TEPonta

TEPonta

    Advanced Member

  • Members
  • PipPipPip
  • 577 posts

Posted 21 September 2008 - 05:33 PM

Okay, got a new one I'm hoping you guys can test for stability. It is a precursor to hopefully replacing the Unit window. The file is attached, unzip to your ExportDLLs folder. When you run the game this DLL will throw up a window with a button to show you information about the units visible in the Unit window (at present it only has information for exactly localized units). It also makes a text file in your HC directory called "hcunitwin.txt".

Yes, I do know it is annoying that it stays on top of the other windows...

Anyway, I'm looking for feedback on whether it crashes your game or causes any other big hardships. It will slow your game down somewhat. The log files aren't too huge so I don't think they'll run you out of space or anything.

Must be used with GE 2008.053 (or newer?).

Tony,

Looks good. No crashes so far. The always on top part isn't a problem as far as I can see since it can be minimized to the TaskBar and quickly accessed from there. Maybe in some future form it can be integrated into the Windows Pull-Down menu. While most of the column headings are fairly easy to figure out, a listing of what each means and what info is contained wouldn't be amiss, maybe in the form of a text file included in the ZIP file? Since the window is always on top when open, the transparency is appreciated.

Buddha

#12 TonyE

TonyE

    Advanced Member

  • Staff Pukes
  • PipPipPip
  • 3,351 posts

Posted 21 September 2008 - 06:16 PM

Thanks for the feedback Buddha.

New version attached (this must be used with 2008.054 GE). Unzip the whole ball of wax with directories in tact to your HCE directory. (so that you'll end up with a HCE\UnitWin directory as well as the updated DLL in ExportDLLs directory.

As with the prior one, this only shows units visible in the Unit window that are exactly detected. Looking again for stability reports and responsiveness of the globe reports. z and x keys to zoom in and out (depending upon what you last clicked).

<attachment removed>

#13 TEPonta

TEPonta

    Advanced Member

  • Members
  • PipPipPip
  • 577 posts

Posted 21 September 2008 - 10:57 PM

Thanks for the feedback Buddha.

New version attached (this must be used with 2008.054 GE). Unzip the whole ball of wax with directories in tact to your HCE directory. (so that you'll end up with a HCE\UnitWin directory as well as the updated DLL in ExportDLLs directory.

As with the prior one, this only shows units visible in the Unit window that are exactly detected. Looking again for stability reports and responsiveness of the globe reports. z and x keys to zoom in and out (depending upon what you last clicked).


Tony,

2 things to report. The map section of the new display always opens in a W.Africa location, regardless of the scenario location. Easily solved by scrolling the display to the proper location.

Secondly, and more important. Selecting File/New from the pull down menu causes an immediate crash when the new game scenario is selected. It is therefore necessary to shut down and reload the game in order to change scenarios.

Buddha

#14 TonyE

TonyE

    Advanced Member

  • Staff Pukes
  • PipPipPip
  • 3,351 posts

Posted 22 September 2008 - 09:26 AM

Acknowledged. That's a bummer on the crashing. I must have only tested opening saves from the same battleset. Will remedy for the next try.

#15 TonyE

TonyE

    Advanced Member

  • Staff Pukes
  • PipPipPip
  • 3,351 posts

Posted 22 September 2008 - 02:09 PM

New version attached (this must be used with 2008.055 GE). Unzip the whole ball of wax with directories in tact to your HCE directory. (so that you'll end up with a HCE\UnitWin directory as well as the updated DLL in ExportDLLs directory.

From yesterday's build added SonoBuoys (it will show them all, not just the ones in the HC unit window).
Hopefully fixed the crash Buddha found when changing battlesets between scens (or even starting a new scen).
Added a couple of other inconsequential tidbits.

Next up is either uncertain units or heading arrows (and maybe saving of settings, that absence is starting to annoy me)

<attachment removed>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users