Well, I finally did it. I uploaded my code as a community plugin.
The plugin I made is sort of a game creator. It’s the toolset I use to build my own little game, but it should be flexible enough to support other games as well. It uses an Entity System, so adding different game logic to support different game types shouldn’t be that hard, just add a different Entity Control and you have a new behaviour.
At the moment, there is top-down movement. This movement is restricted to the viewport, but within that restriction you can move forward, backwards, turn left, turn right, strafe left and strafe right. This is the movement I needed for my own game, which is why it’s the first one I did.
Aside from the movement, you can shoot and there’s a rudimentary AI in there as well already.
The GameCreator currently consists of 3 different community plugins. The main one is the libraries plugin, FS-GameCreator-Libraries. This one contains both the plugin dependencies used by the other two plugins as well as a global library you’d need to add to your own game project to be able to use the GameCreator.
The second plugin is the FS-GameCreator-TemplateEditor. This plugin is used to edit the JSON formatted Entity Templates. An Entity Template is basically a blueprint for an Entity. I currently have one w hich describes a spaceship, so it contains the RenderComponent to tell me what model to load, the CanMoveComponent to tell me the movement characteristics, etc. Editing this JSON file by hand, while doable, is error prone and becomes increasingly difficult as more components come into play. So I setup a GUI for that. This plugin also contains code which ties into the JME Scene Editor. It allows for adding Entity Templates directly to a scene. When a template is added to a scene, it checks for the RenderComponent. If it can find one, it will render the model in there. If it can’t fine one, it will render a placeholder instead, making the node at least visible in the editor.
The third and final plugin is the FS-GameCreator-AiScriptEditor. This plugin is similar to the second one in that it is a GUI for editing a JSON file. This time however the JSON file is an AI script. The AI system uses a block based approach. Each AI block contains a specific set of AI logic. Each block has one entry point, one or more exit points and can be configured either from the scipt or from code. By chaining these blocks together you get the actual script. Currently there is a RangeTrigger, Spawn, Approach, Shoot, Timer and SubScript block. The SubScript block allows for running multiple scripts in parallel. I personally use this one to have the Approach and Shoot subscripts run at the same time so the NPC will follow the player and shoot at him.
Since I started with the libraries plugin, this one is in the most advanced state, call it Beta 2. The Template Editor plugin is also coming along nicely and is probably nearing Beta. The AI Script Editor however is the newest addition. As such it is still in early Alpha and as such is subject to weird behaviour, like menu items showing up in the wrong places.
Now, that’s most of the current features in there. There are loads more planned of course. But to figure out which ones I need to focus on first, I could use some input.
Personally, I was thinking on spanding more time on the AI Script Editor plugin first. Get that one at least to a stable Beta phase, along with the Template Editor Plugin. But if anyone has a a better suggestion, I’m all ears. Eventually, this thing should be able to support a few basic game types with standard configured setup with regards to which Entity Controls / Entity Components to start with. But that’s a long way off still.
Oh yeah, and I’d appreciate any and all offers of help as well, to get this thing to the point where it is actually useasble by as many as possible as soon as possible.
As I mentioned in the thread below, here’s a list of the currently planned features. As always, if you have anything to add, or any priority you would like to see them build, let me know and I’ll see what I can do
- Project Plugin. This plugin would have wizards for the various parts:
- Game Project wizard, depending on selected features, you would get a skeleton game project with all the EntityComponents and EntityControls setup for you.
- EntityComponent wizard, Since the EntityComponents have some meta data to make them play nice with the various plugins it would be nice to have a wizard here as well
- EntityControl wizard, Sets up the basic structure of an entity control.
- AIComponent wizard, similar to the EntityComponent wizard, but for the AI.
- AiControl wizard, similar to the EntityControl wizard but for the AI
- Particle effects, it would be nice to be able to add particle effect. For example when you blow stuff up
- Shaders, those are always nice.
- Light sources, currently light sources are added directly to the scene. I would like to have these as entities as well. This makes working with them from within the system a lot more logical
- AI-Editor canvas, seeing how the AI system is basically a block based system where you add logical blocks together to form the scripts this should lend itself perfectly for a canvas based editor. This would make the AI editor a lot more user friendly
- Tutorials explaining the various parts of the game creator