by Gez » Fri Jun 03, 2016 23:36
Well my advice would be to start learning how to use the "find in files" features (Shift-Ctrl-F) so that you can get your IDE/text editor to look through all of the project file for text strings.
The ZDoom codebase is probably not the simplest there is for Doom ports, given how so many subsystems were rewritten entirely several times. You might be interested in
AutoDoom, by the way.
Anyway, the end of level button is merely a normal linedef, which happens to have a special on it, and that special happens to be, in ZDoom terms, Exit_Normal. So if you want your bot to find out where the exit button is, it'll have to iterate through all linedefs in the level to find those that have an Exit_Normal special. (There's also Exit_Secret, and then there are also a few other exit methods, such as killing all spiderdemons in E3M8, killing all cyberdemons in E2M8, and killing a Romero-head-on-a-stick; but we'll keep it simple for now.) Just looking at the code for the special itself will not help you program your bot, since what you want is finding out where it is on the map.
Also, of course enemies and players all have X, Y coordinates. The engine needs to keep track of them after all! All AActor (it's the internal name in ZDoom for the Actor class, enemies, players, fireballs, pickups, pretty much everything that has a sprite and a lot of things that don't are actors) have coordinates, so again, you can iterate through the list of actors in the game, filter out those that are monsters, and look at their coordinates in comparison to the coordinates of the player's own actor.
Good luck with your project, it is more than quite a little bit ambitious. If you want to try something with the same general idea but a bit simpler, look at Wolfenstein 3D, as the maps are much simpler and you don't have to deal with subtleties like running jumps (e.g. Doom II MAP02), damaging floors, etc. The guy who made AutoDoom started with an
AutoWolf for these reasons.
Well my advice would be to start learning how to use the "find in files" features (Shift-Ctrl-F) so that you can get your IDE/text editor to look through all of the project file for text strings.
The ZDoom codebase is probably not the simplest there is for Doom ports, given how so many subsystems were rewritten entirely several times. You might be interested in [url=https://github.com/ioan-chera/AutoDoom]AutoDoom[/url], by the way.
Anyway, the end of level button is merely a normal linedef, which happens to have a special on it, and that special happens to be, in ZDoom terms, Exit_Normal. So if you want your bot to find out where the exit button is, it'll have to iterate through all linedefs in the level to find those that have an Exit_Normal special. (There's also Exit_Secret, and then there are also a few other exit methods, such as killing all spiderdemons in E3M8, killing all cyberdemons in E2M8, and killing a Romero-head-on-a-stick; but we'll keep it simple for now.) Just looking at the code for the special itself will not help you program your bot, since what you want is finding out where it is on the map.
Also, of course enemies and players all have X, Y coordinates. The engine needs to keep track of them after all! All AActor (it's the internal name in ZDoom for the Actor class, enemies, players, fireballs, pickups, pretty much everything that has a sprite and a lot of things that don't are actors) have coordinates, so again, you can iterate through the list of actors in the game, filter out those that are monsters, and look at their coordinates in comparison to the coordinates of the player's own actor.
Good luck with your project, it is more than quite a little bit ambitious. If you want to try something with the same general idea but a bit simpler, look at Wolfenstein 3D, as the maps are much simpler and you don't have to deal with subtleties like running jumps (e.g. Doom II MAP02), damaging floors, etc. The guy who made AutoDoom started with an [url=https://github.com/ioan-chera/AutoWolf]AutoWolf[/url] for these reasons.