PDA

View Full Version : Can a project be "too generic"




KnightWRX
May 14, 2011, 06:48 PM
So here I am, coding yet another function in my part time hobby project and I think I've come to a realisation. I've made this thing waaaaaaaaaayyyyy too generic.

Looking at LOC count for my project, I'm currently sitting just shy of 4k lines :

$ wc -l main.m Classes/*.[hm] | grep total
3683 total


Yet, this thing does nothing aside from a few NSLog outputs and some very basic "Intro" views being displayed. Every class, every line of code, I've made sure to make everything "configurable". There is no assumption about anything in the data structures, meta-data is first parsed to get the "structure" loaded and then these structures are populated. All dynamically from XML.

Maybe I'm just being too pedantic. As this ever happened to anyone ? I'm pretty sure this thing would probably be done by now if instead I'd just bang out static data structures and made plenty of assumptions about fields just "being there". Of course, then what I'm making (a game engine/a game from that engine) wouldn't be all that powerful to being with.

Sorry for the rant. I've just had a long day and I hate functions with more than 3 imbricated ifs, which I just wrote and got depressed over.



PhoneyDeveloper
May 15, 2011, 09:54 AM
The 80/20 rule always applies. If shipping isn't high on your list of priorities then you probably never will.

Mac_Max
May 18, 2011, 05:41 AM
It sounds like you need more planning before you start coding. There are several planning methodologies out there you can look up & apply or you can simply sit down with a UML editor (or a piece of paper) and create a block diagram of what your program should do & roughly how. Then you can drill down the design & refine it before you start coding. That way you won't have to make three "just in case" functions for every method you actually use.

MorphingDragon
May 18, 2011, 07:27 AM
Oh you're making a game engine. :)

But the real answer is... it depends. :confused:

How complex is it? I made a 2D engine designed for card games and it was only about 3k lines of code.

For a university project we attempted to make a game engine that had a Python like syntax for scripting. It only had rudimentary 3D and could only interpret COLLADA, PNG and OGG files for assests but it ended up being ~10K of code.

So no 4K of code does not seem unreasonable. Do you really need fully dynamic internals though? Even commercial game engines assume a particular microworld.

KnightWRX
May 18, 2011, 04:37 PM
It sounds like you need more planning before you start coding. There are several planning methodologies out there you can look up & apply or you can simply sit down with a UML editor (or a piece of paper) and create a block diagram of what your program should do & roughly how. Then you can drill down the design & refine it before you start coding. That way you won't have to make three "just in case" functions for every method you actually use.

This thing is designed. It's not controlled chaos at all. That's the worse part of it.

Oh you're making a game engine. :)

But the real answer is... it depends. :confused:

How complex is it? I made a 2D engine designed for card games and it was only about 3k lines of code.

Well, considering I'm aiming for some kind of hybrid adventure/RPG game engine (yes, I know... talk about tackling the big stuff), It's not really a surprise. Really, 1500 of those lines are probably just the RPG elements I currently have modeled up. Dropping that out would greatly simplify the model portion.

Maybe I should simplify the concept a bit, at least for version 1.0.

MorphingDragon
May 18, 2011, 06:28 PM
Well, considering I'm aiming for some kind of hybrid adventure/RPG game engine (yes, I know... talk about tackling the big stuff), It's not really a surprise. Really, 1500 of those lines are probably just the RPG elements I currently have modeled up. Dropping that out would greatly simplify the model portion.

Maybe I should simplify the concept a bit, at least for version 1.0.

Maybe. How far through are you (in terms of completion) already? You could model V1 development around the initial game you want to develop for it?

KnightWRX
May 18, 2011, 06:33 PM
Maybe. How far through are you (in terms of completion) already? 10K is not unreasonable for a complex iPhone game. I helped an Australian friend with his UI for a shooter, it was about ~10K of code when I looked at it. It was nearly complete I think too.

Model is about half coded up, View has a lot of infrastructure done, just need to make it all work together to display something (wrote my Splash screen from some parts of it, mostly the Quartz display code), and controller is basically non-existent at this point.

MorphingDragon
May 18, 2011, 06:43 PM
Model is about half coded up, View has a lot of infrastructure done, just need to make it all work together to display something (wrote my Splash screen from some parts of it, mostly the Quartz display code), and controller is basically non-existent at this point.

A lot of the model and logic would be implimented as the scripted part of the individual game though.

It sounds like you are nearly to a point where the core infrasrtucture is emerging. You do have an initial game planned for it don't you? You could base development of V1 around what you need/want to impliment that game, while still retaining the generic programming style.

Would the dynamic internals allow the engine to be modular? You could take advantage of any modularity.

KnightWRX
May 18, 2011, 07:32 PM
A lot of the model and logic would be implimented as the scripted part of the individual game though.

There will be no formal scripting. Events will simply be described and parsed as plain data structures, with a few keywords to generate actions. All logic will be based on those keywords and be static. It should be plenty for the type of engine it will be though, no need for full blown scripting.

It sounds like you are nearly to a point where the core infrasrtucture is emerging. You do have an initial game planned for it don't you? You could base development of V1 around what you need/want to impliment that game, while still retaining the generic programming style.

Yes, I have an initial game planned which should require this thing to be about oohhh... 70% done. My first plans don't include the event handler at all, which should be one of the tougher parts in the model/controller.

I also have a 2nd game planned that should add the event handler. Both will be quite different in terms of gameplay.

Would the dynamic internals allow the engine to be modular? You could take advantage of any modularity.

I hope so, but in the end, it might not be as modular as I want it to be. I guess for now I should just concentrate on moving forward and I'll fix it up later.

The depressing part is not really knowing how much still needs to be done. Sometimes, I set objectives for a day and complete them in an hour, and sometimes, I set objectives for an hour and am still there adding and tweeking a week later. Since I have very little spare time to work on it outside of work/gym/life, it's moving along slowly.

I wish I could afford to just apply and go work at Gameloft or Ubisoft sometimes, but god are those guys underpaid.

MorphingDragon
May 18, 2011, 09:57 PM
There will be no formal scripting. Events will simply be described and parsed as plain data structures, with a few keywords to generate actions. All logic will be based on those keywords and be static. It should be plenty for the type of engine it will be though, no need for full blown scripting.

A Python or Lua bridge would make a quick script engine if you really want one.

The depressing part is not really knowing how much still needs to be done. Sometimes, I set objectives for a day and complete them in an hour, and sometimes, I set objectives for an hour and am still there adding and tweeking a week later.

I know you probably don't want to buy books but if you can somehow get it, this is a good book to have at least a skim through:

http://www.amazon.com/Game-Engine-Architecture-Jason-Gregory/dp/1568814135/ref=sr_1_1?ie=UTF8&qid=1305772898&sr=8-1

It gives a brids eye view of whats in a game engine without actually giving any implementation of such. Its made by one of the lead engineers of Naughty Dog too.

Since I have very little spare time to work on it outside of work/gym/life, it's moving along slowly.

I haven't even had time to finish setting up my Studio Front/Portfolio website, so you're doing much better than me by actually doing SOMETHING. This week I have to finish an updated version of my Linux Guide before Fedora 15 is released so there goes my free tinkering time. University is packing the !@#$ on recently so I've had little free time to begin with. Whenever I come up with ideas for game design I just write it down in a hope to implement it in a later project.

I wish I could afford to just apply and go work at Gameloft or Ubisoft sometimes, but god are those guys underpaid.

I wouldn't mind doing an internship at a game dev company, but I would only really consider working for one of the more independent studios like Valve, Insomniac, ND, Sucker Punch, ID Software or Bethesda. I'd much rather work for some obscure NZ company than some of the other game devs.

---

And yes I did manage to derail a conversation again.

KnightWRX
May 19, 2011, 06:11 AM
I wouldn't mind doing an internship at a game dev company, but I would only really consider working for one of the more independent studios like Valve, Insomniac, ND, Sucker Punch, ID Software or Bethesda. I'd much rather work for some obscure NZ company than some of the other game devs.

The thing is, in Montreal, besides Gameloft or Ubisoft, there's EA (even more underpaid!) or Eidos (which have never really made a title that grabbed me).

MorphingDragon
May 19, 2011, 07:39 AM
The thing is, in Montreal, besides Gameloft or Ubisoft, there's EA (even more underpaid!) or Eidos (which have never really made a title that grabbed me).

I don't mind travelling long distances, so location isn't really an issue as long as I can get a Visa. Australia - New Zealand treaties makes a job in Australia easy to get though. Wouldn't mind working for Google while doing projects on the side. After the recession some studios have started back up again too in Sydney.

KnightWRX
May 19, 2011, 07:46 AM
I don't mind travelling long distances, so location isn't really an issue as long as I can get a Visa. Australia - New Zealand treaties makes a job in Australia easy to get though. Wouldn't mind working for Google while doing projects on the side. After the recession some studios have started back up again too in Sydney.

Well, Google has a job posting in Montreal to work on the Chrome browser. Seems the Chrome team is a bunch of French Canadian know-it-alls. :D

MorphingDragon
May 19, 2011, 08:58 AM
Well, Google has a job posting in Montreal to work on the Chrome browser. Seems the Chrome team is a bunch of French Canadian know-it-alls. :D

What, you suggesting something?

Sydney works on Chrome, Docs, Earth and Android so I could get a wide selection of projects to systematically decimate.