Local Unassuming Guy
Gender: Male
Location: New Jersey, USA
Rank: Suspect
Joined: Sun Aug 19, 2007 2:42 am
Posts: 49
Talk about a blast from the past. :O
Although I haven't posted a single thing in over four years here (let alone thought about the Phoenix Wright games themselves), I once worked on my own case maker engine back in the good old days. I'm not sure what caused me to login in here again and post this -- I blame nostalgia. ;) Anyway, I think I can share a few higher level tips with you!
First and foremost, plan things out. And by plan them out, I mean
seriously give your design some thoughts before you write a single line of code. How will users write their cases? Will you make your own scripting language, or use an existing one and just integrate it into your engine? What features do you plan on supporting from the games themselves? What platforms will you support? Also, how will you deal with graphics? You can either rip them from the ROM, draw your own dynamically, or whatever other idea you think is effective. Lots of questions, not so many answers.
Things like this take a lot more thought than you may initially realize. Make a list of what you want your engine to be capable of doing. Then look at that list again and think about how you will actually implement them in code. I'm not saying you should sit down like a philosopher and start pondering the mysteries of programming, but get at least an overall design going. This includes thinking about how your final product will function. For example, I chose the idea of making a separate editor for users to write their script in, and a corresponding engine that basically read the script and executed it. Or you can somehow integrate the two; make an interface that allows users to write script on the fly and run it as they go. The possibilities are only limited by your immediate skill and how much coffee you can drink to stay awake coding. ;) Of course, there are things you cannot account for, like life events that distract you from your work, but hopefully you'll overcome those if they do arise. Trust me, this will make your life much easier than just winging things as you go.
Once you know what you want to do, gather your tools. If you're using Java, figure out which external libraries you will need to make your API work. For example, if you go for an OpenGL backend to render the graphics, you will need to choose a Java-OpenGL implementation to use. Likewise, if you use a very high level framework that alread has its own APIs for this sort of thing, will it actually provide all the needed functionality? Do the research beforehand; switching libraries mid way is not only painful but it will waste a lot of time as you try to adapt your existing code. Also, look at examples. There are tons of tutorials online about writing game engines, especially places like GameDev.net which provide good conceptual introductions on the matter. You can also look at code that other people wrote. Gather ideas and learn from mistakes before you set out. This is very true when it comes to large projects like a case maker, there are many technical things you probably haven't considered, such as good algorithms for optimizing your graphics code to maximize FPS. Most importantly: test, test, and retest! But you probably know that already. ;)
As for actually coding the damn thing itself, well, that's another story. There is no "de facto" template for writing a game engine. Sure, there are many frameworks out there to help you get started, but ultimately it will depend on your ideas and vision. For example, my engine was basically a giant state machine; I kept track of where the game was at a given point in time and provided context relevant UI options to the user. If you were talking to an NPC, I set certain flags in the state machine and my engine then rendered the correct visual elements on the screen. You may be familiar with finite state automata from your education -- it's something like that. ;) But of course, there are literally thousands of other approaches.
Overall, the real goal is to
have fun! If you treat your project like "work" typically done on university assignments, you will not only get frustrated, but you'll defeat the whole purpose of the project to begin with. Even if you don't succeed, you will learn a tremendous amount about not only game design, but programming in general. I sure did, and I'm sure other programers out there have as well. It may help to post regular updates about your progress, that way you can visually see how much you have done and you will get feedback from users about what looks good and what doesn't.
Here are some resources you may find useful. Many contain example code that will assist you in your first steps:
And last but not least, feel free to look at my old code! :) Sure it's dated, but hopefully you can salvage some concepts from what I've done:
http://pw-case-editor.sourceforge.net.
Good luck! Always happy to see more people interested not only the games themselves, but programming as well. :)
♫ Na dnie serca pozostanie zawsze ślad, kiedy Ciebie już nie będzie tu! ♫