Can a project be "too generic"

Discussion in 'iOS Programming' started by KnightWRX, May 14, 2011.

  1. macrumors Pentium

    KnightWRX

    Joined:
    Jan 28, 2009
    Location:
    Quebec, Canada
    #1
    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 :

    Code:
    $ 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.
     
  2. macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    The 80/20 rule always applies. If shipping isn't high on your list of priorities then you probably never will.
     
  3. macrumors 6502

    Joined:
    Mar 8, 2004
    #3
    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.
     
  4. MorphingDragon, May 18, 2011
    Last edited: May 18, 2011

    macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #4
    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.
     
  5. thread starter macrumors Pentium

    KnightWRX

    Joined:
    Jan 28, 2009
    Location:
    Quebec, Canada
    #5
    This thing is designed. It's not controlled chaos at all. That's the worse part of it.

    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.
     
  6. macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #6
    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?
     
  7. thread starter macrumors Pentium

    KnightWRX

    Joined:
    Jan 28, 2009
    Location:
    Quebec, Canada
    #7
    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.
     
  8. macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #8
    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.
     
  9. KnightWRX, May 18, 2011
    Last edited: May 18, 2011

    thread starter macrumors Pentium

    KnightWRX

    Joined:
    Jan 28, 2009
    Location:
    Quebec, Canada
    #9
    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.

    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.

    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.
     
  10. MorphingDragon, May 18, 2011
    Last edited: May 18, 2011

    macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #10
    A Python or Lua bridge would make a quick script engine if you really want one.

    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-A...4135/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.

    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 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.
     
  11. thread starter macrumors Pentium

    KnightWRX

    Joined:
    Jan 28, 2009
    Location:
    Quebec, Canada
    #11
    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).
     
  12. macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #12
    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.
     
  13. thread starter macrumors Pentium

    KnightWRX

    Joined:
    Jan 28, 2009
    Location:
    Quebec, Canada
    #13
    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
     
  14. macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #14
    What, you suggesting something?

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

Share This Page