1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

A new engine

Discussion in 'Announcements' started by Hapistorique, Oct 5, 2011.

  1. Hapistorique

    Hapistorique KAG Guard Tester

    Messages:
    87
    Posted by MM on his blog :

    "I’ve been trying to code all the stuff we are planning for the next release which you can read here, like coins, workshops and movable ladders. Unfortunately it has become increasingly difficult for me to add stuff with the current engine. The problem with it is that it is a mash-up of 3 games I’ve been working on for the last 5 years and all of the KAG code is more like prototype code than proper game code. I did this because I wasn’t sure KAG would be a success so I just coded it really quickly without thinking much how that will affect the future.
    This method is great and I spent an entire game development lecture last month emphasizing this approach. So if you’re a game developer - please do prototype your games and don’t think much about what will happen later!
    However last Monday I just sat for an hour or so trying to add points scoring for digging resources and I couldn’t do it! I couldn’t figure out a way to do it without breaking the existing game elements or completely rewriting the game.
    So I decided to actually rewrite the KAG engine completely from scratch. Now this is an amazing opportunity for everyone so please take the time to read what benefits there will be from this change:
    1. New additions a lot faster
    2. Less bugs
    3. Much deeper gameplay mechanics
    1) New additions a lot faster
    The rewrite will probably take about 3-6 months before it reaches the stage the game is right now. This will take some time and this is the only negative side of this decision. I know you guys are waiting for new stuff!
    I decided not to drop the current KAG engine and continue developing it along with the new KAG. This means there will be new updates as usual, it’s just that they will probably happen less frequently (as at least half of my time will be spent on the new engine).
    What will happen after these 3 months will be worth the less frequent updates. From then on additions to the game will happen extremely fast. This is because:
    • I am designing the engine in a way so that I can add new stuff very quickly without breaking any code
    • It will be easy for new people to jump in and code with me (Geti is actually designing the engine with me, so we’ll code together)
    • Modding will be even easier than it is now (the engine will use scripts and a plugin architecture from beginning)
    2) Less bugs
    In the current engine it takes me a large amount of time to track and fix bugs. This is because of the spaghetti nature of the code. With the new engine, bugs will happen less frequently and if they do, they will be very easy to debug.
    3) Much deeper gameplay mechanics
    What we have presented publicly is the tip of the iceberg of what we are planning. We are redesigning things like building mechanics and the user interface around building and using items. So the game will not only have more stuff but it will be easier to use them.
    Wish me good luck. I hope we have an even more awesome game in the next half year. In the meantime expect (a little less frequent but still) updates. This will come as promised probably next week:

    [​IMG]

    http://kagdev.tumblr.com/post/11023615550/a-new-engine

    (I didn't see a thread about this)
     
    Static, illu, Valkyrie and 2 others like this.
  2. Im_a_Turtle

    Im_a_Turtle Arsonist

    Messages:
    403
    Modding!!! HHHNNNNGGGG!!!!
    Also are the sprites that i've made and others will be compatible to the new KAG engine? Or do i (YET AGAIN!!!) have to resprite them all to fit the KAG templates?
     
    Neat likes this.
  3. Neat

    Neat King of the Dead Donator Tester

    Messages:
    1,958
    Turtle just came!
     
    Valkyrie likes this.
  4. Mornaval

    Mornaval Shopkeep Stealer

    Messages:
    41
    Liked, commented, subscribed
     
  5. Contrary

    Contrary The Audacious Paramount of Explosive Flight Donator Tester

    Messages:
    2,196
    Haha cool. I'm glad the devs decided to nuke and pave, rather than try to build on a messy foundation.

    This was definitely the manly way to go. *Thumbs up.*

    Will we see the new engine in test build? :p

    Also, I predict that at least half the servers will run the humongous mod that Reactorcore will inevitably make.
     
  6. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    Haha, perhaps. You'll more likely see the old engine getting features crammed into it in a test build. The new version is literally a nuke and pave. We got the command console and a mouse cursor rendering and are just sorting out a fairly fundamental aspect of the core type. Literally everything is gone.

    Modding will be limited at first because we need some way of preventing free players getting all the paid stuff through mods. It might be as simple as blocking certain key types (such as the ones required for mechanims) from functioning without a gold-only flag on the server.

    You might have to rearrange, you might not. I'm going to make spritesheets read left to right top to bottom if it's the last thing I do, sick of these huge strips D:<
     
    Valkyrie likes this.
  7. Wonkyth

    Wonkyth More precious than carbuncles! Donator Tester

    Messages:
    1,350
    This all looks fantastic to me!
     
  8. Snow

    Snow KAG Guard Tester

    Messages:
    94
    So long as the new engine is properly coded.. and by that I mean the typical top-down style or rather just very neatly organized. I too am working on a game (though much less and simpler code), but I started on it as a prototype before I even had menu screens in it. It's also written in Lua, so I had to figure out a different way to create instances of objects. Now my game is a set of functions that all run at the same time.. so not even a game loop haha. So now I have to put all the code within a loop hopefully without breaking the timing and then of course I can finally put in the menu and game over screens. :P I just kept building up a prototype of a bunch of smaller prototype functions. So far it all works together quite nicely.
     
  9. Shadlington

    Shadlington THD Team THD Team Administrator Global Moderator

    Messages:
    1,562
    You could just make modding gold-only?
     
  10. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    @Shadlington: that's being considered as a very good possibility.
     
  11. Valkyrie

    Valkyrie Shark Slayer

    Messages:
    681
    I'm so glad we're going in the nuke and pave direction unlike minecraft which bugs still exist for and always will.
     
  12. Snow

    Snow KAG Guard Tester

    Messages:
    94
    Yup. Biggest issue is that Minecraft was made with Java. Java's an awesome language, however a game like Minecraft is too much. Should have been written in C++ or similar language.
     
  13. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    Eh, I wouldn't agree with that. Using whatever you're comfortable with is important, and C++ doesn't really offer any key advantages over java than a bit of speed these days.
     
    Chiguireitor and Valkyrie like this.
  14. Wonkyth

    Wonkyth More precious than carbuncles! Donator Tester

    Messages:
    1,350
    Yeah, people are always slagging of on Java. I mean, it's been over a decade since it got an awesome upgrade and people still say it has shit performance? Come on! Sure, it's still only half as fast as something you can do in C or whatever, but performance is not linked with buggyness. If anything, you're going to get LESS bugs developing a game on Java, what with it's reliable garbage collection and all.
     
  15. Snow

    Snow KAG Guard Tester

    Messages:
    94
    It's not that. It's the fact that it runs on a virtual machine. It takes a lot of cpu power. That's all. I'm a huge fan of Java otherwise and even hope that I get to do Java development if I find a programming job soon. :P I should have explained.
     
  16. Wonkyth

    Wonkyth More precious than carbuncles! Donator Tester

    Messages:
    1,350
    Fair enough. :)
     
  17. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    As true as that is, Snow, JVM is stupidly well optimised for pretty much every architecture that it runs on. In "real" use most java programs take ~20% more CPU time afaik which only becomes a large problem when you're trying to write low-latency serverside stuff (where absolutely every optimisation counts). I wouldn't say "a lot" of CPU power is needed, especially not in the context of a game.
    Often it's more productive to compromise performance for ease of use, unless you're planning on running some sort of horribly computationally complex simulation (say, dwarf fortress).

    That's just my experience, but I'd be complaining less about java's performance and more about its implementation of generics ;)
     
  18. Mathewson

    Mathewson Shopkeep Stealer

    Messages:
    82
    Java also runs terrible on macs. atm nobody develops it further for macs.
     
  19. Im_a_Turtle

    Im_a_Turtle Arsonist

    Messages:
    403
    Geti, will this new build give each class/structure their own sound/sprite folder? because i have an insane amounts of sprite and sound mods that are just waiting to be tapped into (15 sound packs woot!) And if this is true, it will be a step closer to my mega mod i'm planning on.
     
    Valkyrie likes this.