Archived

This topic is now archived and is closed to further replies.

slepyii

GD Arena - Launch Pad (v1.04 Released 8-28-2003)

Recommended Posts

slepyii    122
Hi All, I have created a launch pad application that lists the bots available in the bots directory and lets you choose which two you want to battle. You can also set the following options:     - Set debug flag     - Maximize arena on launch     - Auto start battles     - Auto Show FOV     - Run Multiple Matches Click to get to the site and download.
This basically lets you easily switch the bots that battle without having to edit the INI file, even though its not that hard. - Timothy S.
Update 8/28/2003      - Bug Fix: Bot list is now reset every time arena path is changed      - Eliminated Hidden window style      - Removed Match Time from Auto-Close parameters      - Added Always On Top option to Debug Output      - Added Match Results window      - Auto close now uses the GDAResults.txt file to determine end of match condition      - Debug log window has been cleaned up and now only contains the Rich Edit control Update 8/22/2003      - Updated, simplified user interface (Advanced options now under an advanced options dialog)      - Ability to set the Arena path (Launch Pad no longer has to be in the same folder as the main Arena application)      - Can now minimize window      - Window now has an icon / system menu      - Focus is kept on Launch button when window is restored after launching arena      - You can now start the arena Normal, Maximized, Minimized, or Hidden      - Only displays bots with the correct interface version (Uses highest version found when searching for bot DLLs)      - Window positions are saved between runs      - Added debug output window and have included code for bots to communicate with it      - Didn't loose ability to read old config files so all your old settings are still valid and converted to the new file format when you close Launch Pad      - And finally has a new home at gdarena.sleepyware.com! [edited by - slepyii on August 28, 2003 12:32:27 AM]

Share this post


Link to post
Share on other sites
Jason2Jason    166
I don''t see why he''d have any problems with that. It''s just a tool, as long as it doesn''t hack the exe, but we''ll see what he says. I''ll defently be using it if its OKayed though.

-J

Share this post


Link to post
Share on other sites
slepyii    122
Its released! Took a bit longer than I had hoped to get it online but its up. I have tested to make sure it works on 2000 and 98. Don't have access to any other OS's so this can be considered a trial run.


To run you will need to place it in same folder as the GD Arena executable, select your bots and click Launch. It will hide itself until GD Arena is closed. The version information is pulled from the version resources in the file and displays n/a if none are available.


The only planned improvement is verifying that the DLLs are valid bots, and displaying the Interface version of GD Arena if its ever made available. If this is true then I will update the bot detection logic to only list bots that use that version of the interface.

Clicky to go to the site and download.

- Timothy

[edited by - slepyii on August 5, 2003 8:08:15 PM]

Share this post


Link to post
Share on other sites
Jason2Jason    166
Yep, seems to work as it should, though I''ll let you know if there are any problems. Maybe a feature you could add in is a auto-restart to reply matches n times. I think that might get implemented in a newer version of the arena, but you could save Khawk some hassel if you do it with this.

Great job,

-J

Share this post


Link to post
Share on other sites
RapidStunna    122
Great job! I love it - and it''s helpful - although I think that you should store the previous two bots that were loaded up so you can simply start up the program and have those two already selected. How you do that is up to you. I''d do something with the registry because a file would be annoying to have to carry along. Just my thoughts.

By the way, how did you get the field of view to show up? and the auto-start option, that was done by sending f5 key messages at the beginning right?

---
Brent Gunning | My Site

Share this post


Link to post
Share on other sites
Jason2Jason    166
quote:
Original post by RapidStunna
Great job! I love it - and it''s helpful - although I think that you should store the previous two bots that were loaded up so you can simply start up the program and have those two already selected. How you do that is up to you. I''d do something with the registry because a file would be annoying to have to carry along. Just my thoughts.



I agree, infact not only the bots, but the settings (eg debug, maximized etc) should be stored too. I think a file (like a ini) would be a better way of storing it. If you did use the registry, then (for politness) you should provide a uninstaller to remove the registry crap if i ever remove the program. So a file is easier.

-J

Share this post


Link to post
Share on other sites
slepyii    122
New update. This addresses both concerns above, mainly ability to run multiple matches and saving of settings. Only advantage I can see with running multiple matches is to help your bot learn as I have no way of knowing who won what match. Update would have been out sooner, but I was trying to eliminate both concerns of the registry and external cfg file by saving the settings in the EXE. Unfortunattly I found out the hard way you can't modify data already in the EXE, but you can append data . . . go figure. Didn't feel like having the EXE grow in size each time you closed so the data is in a CFG file.


quote:
Original post by RapidStunna
By the way, how did you get the field of view to show up? and the auto-start option, that was done by sending f5 key messages at the beginning right?

This is done by creating the process, and then waiting for it to start up completley. After this is done I enumerate the Windows created by it, using the first visible one I find, and then use ShowWindow() to maximize it if so desired. I use PostThreadMessage() mimicing WM_KEYDOWN & WM_KEYUP for F5 to start the match, and F10 to show the FOV. Better yet, source is better than 1000 words, so here is the relavent section:

BOOL CALLBACK EnumWndProc(HWND hwnd, LPARAM lParam)
{
SLaunchInfo * LaunchInfo = (SLaunchInfo *)lParam;

if (!LaunchInfo)
return FALSE;

if (IsWindowVisible(hwnd))
{
if (LaunchInfo->FullScreen)
ShowWindow(hwnd, SW_MAXIMIZE);

if (LaunchInfo->StartMatch)
{
PostThreadMessage(GetWindowThreadProcessId(hwnd, NULL), WM_KEYDOWN, VK_F5, 1);
PostThreadMessage(GetWindowThreadProcessId(hwnd, NULL), WM_KEYUP, VK_F5, 1 & 3 << 31);
}

if (LaunchInfo->ShowFOV)
{
PostThreadMessage(GetWindowThreadProcessId(hwnd, NULL), WM_KEYDOWN, VK_F10, 1);
PostThreadMessage(GetWindowThreadProcessId(hwnd, NULL), WM_KEYUP, VK_F10, 1 & 3 << 31);
}


return FALSE;
}

return TRUE;
}

// < code snipped setting up for this >


if (!CreateProcess(app, NULL, NULL, NULL, FALSE, 0, NULL, Path, &sInfo, &pInfo))
return FALSE;

WaitForInputIdle(pInfo.hProcess, 3000);

ShowWindow(hwnd, SW_MINIMIZE);
ShowWindow(hwnd, SW_HIDE);

EnumThreadWindows(pInfo.dwThreadId, EnumWndProc, (LPARAM)LaunchInfo);

// < more code snipped that waits for the process to terminate or a time limit to expire, and then Killing the process





P.S. Kevin, if you want the source send me an e-mail and I will send it your way .

[edited by - slepyii on August 5, 2003 12:45:26 AM]

Share this post


Link to post
Share on other sites
Jason2Jason    166
Just a quick question. How does the launch pad detect the bot version number? Or better yet how do i assign a version number to my bot that can be read by your app?

-J

Share this post


Link to post
Share on other sites
Jason2Jason    166
Also I don''t know if its possible, but it would be good if you could detect when the match ends before the time is up so you can restart. Its no big deal, it just means I have to either wait for the timer i set in the launch pad to end or close it myself.

Other than that its really useful!

-J

Share this post


Link to post
Share on other sites
khawk    2902
quote:
Original post by Jason2Jason
Just a quick question. How does the launch pad detect the bot version number? Or better yet how do i assign a version number to my bot that can be read by your app?

-J


Bot version numbers will be coming in the next update. There will also be arena interface version numbers to make sure that a bot has been built with the correct arena interface.

Share this post


Link to post
Share on other sites
khawk    2902
quote:
Original post by slepyii
P.S. Kevin, if you want the source send me an e-mail and I will send it your way .



I will at some point, but keep it to yourself for now. I don''t need anything else to maintain at the moment. Good job! I like it.


Share this post


Link to post
Share on other sites
slepyii    122
quote:
Original post by Jason2Jason
Just a quick question. How does the launch pad detect the bot version number? Or better yet how do i assign a version number to my bot that can be read by your app?



I pull this information from the version resource of the file. To add this you will need to add a resource script to the DLL, and then add a version resource and set your bots version.

quote:
Original post by KHawk
Bot version numbers will be coming in the next update. There will also be arena interface version numbers to make sure that a bot has been built with the correct arena interface.



This would be a time to get users opinions if they want this app to display the bot version exported by the arena interface, or continue to get it from the version resource of the file.


quote:
Original post by Jason2Jason
Also I don''t know if its possible, but it would be good if you could detect when the match ends before the time is up so you can restart. Its no big deal, it just means I have to either wait for the timer i set in the launch pad to end or close it myself.

Other than that its really useful!

-J


This is currently not possible. Hopefully Kevin can implement return codes, or use a printf() call to stdout after the match has ended. Either way will allow me to detect when the match has ended and then close and restart. Once this is done I will eliminate the Match Time parameter as it will no longer be needed.

Share this post


Link to post
Share on other sites
slepyii    122
New update is online. This version just adds checking to make sure bots are compatible with v0.2 of the Arena API. Also made a small change to how the version information is displayed. Resource script version resources are queried first, and then from the Arena API exports of the DLL.

If anyone has problems running this, or it doesn''t work as expected please let me know. Also all feature requests will be considered, so let me know if you have ideas . . .

- Timothy S

Share this post


Link to post
Share on other sites
flipper76108    122
thanks for this handy little tool slepyii. i have some requests if you don''t mind:

could you rebuild it using something other than the introductory version of VC++? i''d be happy to build it for you if you don''t have access to another VC++ setup.

could you have the window''s last position saved and restored via the cfg?

once Launch has been selected, could you keep the keyboard focus on that button instead of placing it back on the listview?

could you add a minimize style to the titlebar so that the window can be minimized?

could you add a sysmenu to the titlebar so that the window can be closed by double-clicking the sysmenu''s icon?

thanks again.

Share this post


Link to post
Share on other sites
slepyii    122
quote:
Original post by flipper76108
thanks for this handy little tool slepyii.

Glad you like it, tis the reason I made it .

quote:
Original post by flipper76108
i have some requests if you don't mind:

could you rebuild it using something other than the introductory version of VC++? i'd be happy to build it for you if you don't have access to another VC++ setup.

This is most likely due to a bot DLL being built with the Introductory edition of MSVC. I load up the DLL's to make sure they are valid bots. I use MSVC 6.0 Pro.

quote:
Original post by flipper76108
could you have the window's last position saved and restored via the cfg?

once Launch has been selected, could you keep the keyboard focus on that button instead of placing it back on the listview?

could you add a minimize style to the titlebar so that the window can be minimized?

could you add a sysmenu to the titlebar so that the window can be closed by double-clicking the sysmenu's icon?

thanks again.

All of these issues and more will be addressed in the next release. Its going to be a couple days though as I'm changing hosting providers, designing a site for all things GameDev: Arena related I create, and am busy with work (Crunch times can be a pain) and family functions.

I am adding one new feature though that many may find useful, but you will just have to wait for the release to see what it is .

- Timothy S.


[edited by - slepyii on August 13, 2003 3:09:17 PM]

Share this post


Link to post
Share on other sites
flipper76108    122
quote:
Original post by slepyii
quote:
Original post by flipper76108
i have some requests if you don''t mind:

could you rebuild it using something other than the introductory version of VC++? i''d be happy to build it for you if you don''t have access to another VC++ setup.

This is most likely due to a bot DLL being built with the Introductory edition of MSVC. I load up the DLL''s to make sure they are valid bots. I use MSVC 6.0 Pro.


dummy me. sorry about that. it was my bot that was causing the problem too!

i''m looking forward to the next version. i had one more request but i''ll hold off until you get it released to see if it''s in there or not.

Share this post


Link to post
Share on other sites
slepyii    122
quote:
Original post by flipper76108
i'm looking forward to the next version. i had one more request but i'll hold off until you get it released to see if it's in there or not.


Update should be coming in the next couple of days. I have the biggest hurdle completed now, so now it's just a matter of getting the second biggest one completed, and then tying up a few loose ends.

Most of the new web site design is also done so it's just a matter of moving content to it and activating everything, and then getting the final version online.

Some of the new features without revealing the biggest one are:
   - Updated, simplified user interface (Advanced options moved to new advanced config dialog)
   - Ability to set Arena Path
   - Can now minimize window
   - Window has icon / system menu
   - Focus is kept on Launch button when restored
   - Arena window can now start maximized, normal, minimized, or hidden (not recommended, for testing purposes)
   - Window position is saved
   - Didn't loose ability to read old config files so all your old settings are still valid

That is the majority of what is new in the upcoming release, though there may be a few more things that I have missed. If your other idea is not on the list let me know and I will try to squeeze it into this update if I have time .

- Timothy S.

[edit] - Fixed an apostrophe, was turned into a ? somehow ;(

[edited by - slepyii on August 18, 2003 10:49:55 PM]

Share this post


Link to post
Share on other sites
slepyii    122
v1.03 is Online! After a long delay its finally available, and hopefully its worth the wait. Would have been online sooner if things would not have broken for 98 . Its all good now so here is the list of updates . . .

     - Updated, simplified user interface (Advanced options now under an advanced options dialog)
     - Ability to set the Arena path (Launch Pad no longer has to be in the same folder as the main Arena application)
     - Can now minimize window
     - Window now has an icon / system menu
     - Focus is kept on Launch button when window is restored after launching arena
     - You can now start the arena Normal, Maximized, Minimized, or Hidden
     - Only displays bots with the correct interface version (Uses highest version found when searching for bot DLLs)
     - Window positions are saved between runs
     - Added debug output window and have included code for bots to communicate with it
     - Didn't loose ability to read old config files so all your old settings are still valid and converted to the new file format when you close Launch Pad

Phew, that was a long list. Now, the biggest addition is the debug log window! I am hoping that you all find it useful when debugging your bots as its extremely easy to use, and fast (~200 calls/sec on my system)! There is one minor issue with it though on 98 where it doesn't want to scroll, so if anyone has experience with getting Rich Edit 2.0 controls to scroll either using EM_SCROLLCARET or EM_LINESCROLL e-mail me so I can fix it! I am going to keep searching for a solution in the mean time.

The debug log window is used by adding two files to your project, and then calling InitializeDebugLog in AttachToGame or Init of the bot class. Once this is done then you just call the DLOG macro exactly like you were calling printf. After you are finished using the Debug Log then you call DestroyDebugLog, most likely in the ReleaseBotInterface function. There, now isn't that easy !

The last item for tonight is Launch Pad has a new home . You can now find it at gdarena.sleepyware.com.

As usual if there are any problems, or feature requests let me know.

- Timothy S.

[edited by - slepyii on August 22, 2003 12:19:30 AM]

Share this post


Link to post
Share on other sites
slepyii    122
Hi All,
A new update, v1.04, is online. This uses the GDAResults.txt file to display match results and to detect the end of match. I have eliminated the match time parameter because of this so you should now be able to set it up to run matches one right after the other. I have also fixed a minor bug. More details can be found on the change history page on my web site.

Documentation updates, etc. will be coming in the next day or two as I want to get to bed now as its getting late here .

As always if anyone runs into problems, or has ideas, feel free to contact me either via the forum or e-mail.

- Timothy S.

Share this post


Link to post
Share on other sites