This post is release/documentation of two semi-automated debugging tools for game devs.
Both tools are game-agnostic and should work fine when dropped into any game. They are both designed to be used only with sdd and only with 96.0+.
1. Recorder
This records 60 seconds of a game between two allyteams and plays it back. It doesn't record everything (see the code for details) but it records enough that the playback looks very similar to the original.
To record, drop the widget http://imolarpg.dyndns.org/trac/balates ... r_save.lua into /luaui/widgets and type "/saveunits", then wait 60 seconds (of game time, it will say when its done). This will create four files name REC_XXX.lua in /spring.
To replay, drop the gadget http://imolarpg.dyndns.org/trac/balates ... r_load.lua into /laurules/gadgets. Move the four REC_XXX.lua files into luarules/configs. Start an (empty) game with two allyteams and a high unit limit, on the same map, and then type "/luarules loadunits".
The replay step can take place on a different Spring version to the saving step, and can even take place with a different game if the (internal) unit names and custom cmdIDs match. The replay functionality has some more features too (http://imolarpg.dyndns.org/trac/balates ... ad.lua#L44) for placing only particular types of unit, controlling when the orders start to be given and for clearing the map.
There is a modification of this system (by GoogleFrog) that is compatible with 91.0, which can be found inside ZK.
2. Spamalot
This gadget spawns random units all over the map, and then gives them orders that cause a massive brawl. As well as that, it runs deliberately heavy lua code that regulates the unit density to be constant across the map. It knows to spawn only water units on water and spawns some proportion of aircraft everywhere. It also moves the camera around by itself to random positions.
To use it simply drop the gadget http://imolarpg.dyndns.org/trac/balates ... AMALOT.lua into /luarules/gadgets and run a game (on any map) with at least two allyteams. There are various settings at the top of the file which control its behaviour.
Report bugs etc to this thread.
Two debugging tools for game devs (Recorder, Spamalot)
Moderator: Moderators
- Silentwings
- Posts: 3720
- Joined: 25 Oct 2008, 00:23
Re: Two debugging tools for game devs (Recorder, Spamalot)
Thanks, those are very useful tools, I like especially the second one (and the name too)
I would recommend on line 182 (http://imolarpg.dyndns.org/trac/balates ... T.lua#L182) to first check for cheat mode with Spring.IsCheatingEnabled() as devs may have already other gadgets enabling that.
I would recommend on line 182 (http://imolarpg.dyndns.org/trac/balates ... T.lua#L182) to first check for cheat mode with Spring.IsCheatingEnabled() as devs may have already other gadgets enabling that.