This project took quite a long time and was a bit frustrating, for similar reasons to those I encountered when developing Noughts and Crosses and Wildards, Oh My! - for want of a better description, after a while the AI seemed to get "confused" about what was happening, and in fixing an issue, it messed up something that was working perfectly well before. (Admittedly I have encountered this phenomenon many times before with normal coding!) I used Gemini for this project - although in retrospect I should have used 2.5 Pro instead of 2.5 Flash - it has the advantage over ChatGPT that you can preview the running code in the console, which is a nice time-saver for testing.
As with most of the other projects, the initial phase got something working along the lines of what I wanted very quickly - in this case particularly, with gathering a lot of data and structuring it for use within the web page, the time-saving was fantastic. Then once again, just on the cusp if it becoming what I wanted it to, things started to go wrong. In my secular job I use AI for data analysis, drafting documentation and prototyping - and this is still where I believe the key benefits of AI exist at this stage, quickly putting something decent together that can be refined by humans (possibly with the assistance of AI, possibly without) - but that step from conceptualising to prototyping to the finished article seems, at present, to be a difficult hurdle.
After trying and failing a few times to get it to the state I wanted it to, I asked AI to take everything I'd already asked for and turn it into a comprehensive prompt to start the process from scratch (still in Gemini). This accomplished, I started a new conversation with this prompt and began again.
As it turned out, there was still a long way to go. The game was working absolutely fine until I asked it to introduce an extra step to choose the game length (10, 20 or 30 questions) - something about the code logic was failing here, and I couldn't get it right. One of my rules for this experiment of using AI to create small JavaScript games was that absolutely everything had to be done by the AI - so I didn't investigate the code myself or make any changes. Eventually I had to abandon this idea and go with a straight set of 20 questions each time.
Again, when I asked it to add social media buttons it worked great, but when I wanted to add a tweak later, things started going wrong. Now I must admit, my knowledge of the limitations of vanilla JavaScript is very... well, you know, limited - so perhaps the AI itself was not entirely the problem here, although eventually I did get it to work how I wanted it to (or at least, I think I did).
There was also the odd case of some hallucinating publisher information - it came up with a fictitious publisher for my own Captain Disaster games, and when I pointed out this error, it hallucinated a different publisher! (By "fictitious" I mean it was not the publisher for the games, not that the publisher itself didn't exist.) I solved that - I think! - by telling it to use the developer name for indie games where no publisher was specified.
I ended up using about 50 prompts to reach this stage, and I realise now that I added things at early iterations that I should probably have removed (or realised would not be needed later) - for instance, I started by getting it to pull the game titles of just the major series first - Monkey Island, Broken Sword, Tex Murphy, King's / Space / Police Quest - which obviously created a lot of duplication in my early tests. So, I added the key title words to the exclusion list (so they wouldn't be repeatedly used when the game was played) - this made sense at the time with a database of about 30 games, but with it expanded out to the current list of 217, it would actually be better to take them out of the exclusion list. (I'm a little reluctant to do this now, given that previous simple requests have caused other things to fail!)
All in all, this has been an interesting development project and I'm reasonably happy with the end result (not saying I won't necessarily tweak it occasionally, of course!) It's been interesting comparing the strengths and weaknesses of this development methodology compared to my normal coding efforts. Other AIs - especially paid ones or those developed specifically for coding modalities - may be better, but for the purposes of my experiment, I'm only using free models. There are ways in which AI can aid the coding flow, but certainly at this point any idea of AI replacing that flow seem a long way off (I'm not saying it would be desirable for that to happen, I'm just considering what is possible).
If anyone else out there wants to create apps with AI, it is certainly possible - but being able to clearly states your requirements and have an understanding of the underlying logic in the code, even if not the code itself, is important. I guess this was actually a moderately ambitious project given my self-imposed limitations, but it's something I'd had in mind to do for quite some time.
Anyway, I'm probably going to leave AI alone for a while as I have lots of voice lines to process for Captain Disaster and the Two Worlds of Riskara (no AI code, art, music, voices etc in that one!! 😎 Just lots... and lots... and lots of work...)
No comments:
Post a Comment