(gif image, wait for loading to see it in action)
Hi, I just want to let community knows about additional feature I'm currently on to.
The goal is for faster iteration time in making a module, and better debugging right inside the game.
Right now, I've hard-coded key combination to be ctrl+alt+c to show/hide a console.
This feature is enabled only when you configure a directive inside dev.txt to enable it; in which I've planned to add ability to turn on/off features which are directly related to devs in there i.e. turn off showing engine's credits screen which popped up randomly etc. Just about now, focus is on devconsole.
Few ideas I can think of for benefit of devconsole
[list type=decimal]
[*]directly jump into specific level to play-test
[*]spawn specific enemy character/object/item etc
[*]reloading model.txt on-demand without a need to close the game, quicker to see things in action, reduce time
[*]what can be done with directive/commands inside those .txt files should technically be possible right inside devconsole
[/list]
A concern and approach to tackle this
- Performance & Security : I'm still thinking about this, no conclusion yet. What I thought is devconsole (and possibly entire dev.txt) should be enabled on-demand by devs that need it. This might possibly mean it'd be possible only when devs build openbor by themselves providing a certain compilation flag etc at build time. If build time has no such flag, even dev.txt is there, dev features won't be there, users cannot pop a console up in game as well as those related code won't actually be present when compile and won't get in the way of other part of execution; especially checking for key and input part. Something along that line. A use of compilation flag is to prevent devs from unintentionally release a module but with devconsole enabled, make it explicit when devs need it. What do you think? I'll think about this more.
In case anyone want to check out such feature (warning: hot code, not yet fully stable), clone dev_features branch from my forked repo https://github.com/abzico/openbor. Build it (for now) either with or without BUILD_DEBUG=1 then define the following lines inside dev.txt (putting at the same level of video.txt and others).
Code:
# console [bi]
# 1 - to enable in-game console support
# 0 - to disable in-game console support (default)
console 1
You have 2 commands
[list type=decimal]
[*]version - to get current openbor engine's version string
[*]level <filename to level file (.txt)> - to load and directly jump to play such level (warning: not work fully & cleanly yet as refactoring current openbor's code base need to be done in order to achieve this, you can still see problem like z limitation mis-match for such level, etc. Anway, this is a prove-of-concept.
[/list]
Feel free to let me know your thought here, anything you want to see and use in devconsole, suggestion, or anything. I will come back to continue working on this after a week.
Thanks
PS. Thanks to Kratus for amazing Streets of Rage 2 v.1.4 module which I used above for recording as gif, and a foundation for learning about OpenBOR as well. Your module works well even with latest OpenBOR's code base with changes added up until now.