DEV Community

tomokat
tomokat

Posted on

End up building a decent ADV game engine with Antigravity and Chat GPT

I didn't expect this at all - at first I was just thinking "I can probably use Antigravity to help me set up Phaser 3 project and once I get the scaffolding done, I probably need to code manually"

It turns out, so far I didn't write any code - only thing I'm doing is to provide scenario/image data and I'm continued to be amazed how much it can understand and how capable this beast is! I mean I need to have very specific need/want in my game design (I knew it is technically possible with Phaser 3 already have many capabilities) and based off of my past experience (though that time what I was doing is quite laughable), I have general idea of how I might want to put my scenario file data but AI just extended to the place where I didn't imagine.

Let me explain this a bit - the format I came up with initially was CSV with headers like:

scene,idx,op,speaker,message,text_id,bg,char1,char2,char3,icon,ui,tags,goto
Enter fullscreen mode Exit fullscreen mode

if you ever made ADV game before you can probably guess what these are and I was quite happy how I can externalize scenario data from the main game codebase. This is where you want to be able to quickly iterate, fix, try etc. but CSV is not easiest for human to deal with so I started to ask question to Chat GPT - after exchanging few message, it then suggest to me the idea of asking Antigravity to write utility tool (in node) to read much simpler "scenario data" and then covert to CSV file format. That was brilliant idea and after explaining what I want, Antigravity one shot implement this (I do need to tweak a bit but still ...)

Here is an example of how "raw scenario data" get converted - best part of this approach is that I no longer need to deal with "number of comma" and "manually keeping track of idx"!

from (opening_jp.txt)

@bg destruction_of_world
@ui DIALOG
@chars alexis@C:neutral
@face alexis:neutral
アクシス:な、何が起きてるんだ?

@bg black
@ui NODIALOG
@chars clear
@face clear
[NARR] それは、もう終わったはずの物語だった
Enter fullscreen mode Exit fullscreen mode

to (scene_script.csv)

opening,10,SAY,アクシス,な、何が起きてるんだ?,,destruction_of_world,alexis@C:neutral,,,alexis:neutral,DIALOG,,
opening,20,NARR,,それは、もう終わったはずの物語だった,,black,,,,,NODIALOG,,
Enter fullscreen mode Exit fullscreen mode

(sorry I'm building this game in Japanese but hopefully you get the gist of this)

and this is how it appeared in the game:

Image of dialog scene generated by the script above

(note: this is still very early days of the game and likely to change - I just want to see how I can display character(s), show face icon and then be able to display message)

I feel with this (and very preliminary yet powerful event system via events.json), I should be able to focus on writing a story for this game (again, I'm not trying to just build ADV game so there are tons of things I still need to work on but so far I probably spent ~1 day of effort and compared to how much time I spent in the past with my Android game, this feels like I'm flying all thanks to AI!)

Top comments (0)