Defining Awesome — New engine part 1
  • Status Updates

  • New engine part 1

    Written by . Posted at 1:32 pm on October 20th, 2011

    I need to clear my mind about some things and ask my long time readers for some opinions.
    You might have read the latest post on the King Arthur’s Gold blog. It’s called Adventures, Overworlds and the Full Version. If you have been following this devlog then you’ll see that there is nothing new there. I’ve talked about these ideas here and here.

    Why didn’t I do that with Link-Dead?

    Because I was struggling with a solid foundation. This time, with KAG, I have a solid foundation and can build upon it.

    Or can I?

    The problem I am facing now is that the KAG engine is terribly written. Because it is a mesh of Crimson Glory and Link-Dead code on top of which I basically “Ludum Dare’d” a completely new game. I am actually really proud of my development speed. It took me just 5 months to have a really deep fun game, a growing community and make money off of it.

    But you know me. I am never satisfied with my work because I have haunting visions of the game I would REALLY want to play. And that game involves going on non-scripted adventures with your team-mates, building civilizations and waging war.

    So now I’m trying to do that. The current engine is a mess and when I add something I need to spend the next 3 days fixing bugs after that. Which is OK and I will probably go on like this for the next couple months with the free/classic version of KAG. However for the full version this is unacceptable. This is why I have already announced A New Engine.

    The new engine will fix all the previous engine issues because I know how to engineer good code. Bad code was just my choice (I still highly recommend it!!!)

    I wrote the basics of the engine when I encountered a roadblock. Mainly, the thought: if I’m gonna rewrite this game why not rewrite it in some nicer language than C++ and make it browser based? I’d love to have the game in a browser because that way I can reach out to a larger audience and it is cross-platform out of the box. Java came to my mind but I don’t like Java. I know something better, a language called Scala.

    Scala is like SuperHeavy or the Travelling Wilbury’s or Ringo’s All Starr’s. It’s a blend of the best features of programming languages and it works on top of Java. So it can be launched as an applet and use all of Java’s gigantic libraries. Programming in Scala feels like smooth sailing compared to hitting rocks with a hammer (C++).

    So Scala is nice but the problem is – I am not efficient in it. I just haven’t learned it well and I need to code with documentation in hand, which is sloooow. I figure it would take me about a year to become efficient in Scala and the next year would be actually making the game. Too long, taking into account that the world is gonna exist only for a year longer.

    So I ditched Scala and am back to C++.
    I should get back to writing the new engine but again I am facing an obstacle – the possibility of actually largely refactoring the current engine. Something like live organ transplant in the programming world.
    I have to go out, so I’ll write a second part later… cya

    Be Sociable, Share!


    1. Haskell is one of the most powerful and elegant programming language ever. TRY IT!

    2. Reactorcore

      Alright, you didn’t forget about my request! Much appreciated.

      What about using C#, MM? I hear its better than C++ (easier to use and overall improved).

      As for refactoring the engine… that sounds somewhat risky. A safe way to do something like that would be not to transplant the current engine physically, but rather analyse what matters, take the good ideas of the current engine, figure out the requirements on paper, improve the recipe and then build the new engine using that.

      In either case, to do this properly, you’ll be forced to sit down with a pen and paper to figure how to build the new engine regardless. This might take considerable time to do so properly, but its well worth it. But only so if you’re confident that it will work.

      If unsure, a good bet might be to simply do the new engine with the same method you built this one, but this time with a functional floor plan, if only not a bit rough.

      Really, it depends on how much time you have. If you can afford to sit on your ass and think hard to design a good foundation, then thats good, but you wont really get much done physically, aside from design documents and notes. This means you won’t be able to produce content for the public to make money of it, unless you do something else besides this new engine.

      In short, its a gamble between the ultimate game that you can make after long proper design and something that you can release as fast as possible to the public.

    3. The problem with C# is that it is not very portable. While there exists some implementations for non-Windows platforms, they aren’t stable in sense of library/interfaces or implementation quality and robustness.

      Let’s face it, the desktop is dead. Everything moves to web. All the “apps” you use are on the web already. Who uses MSN these days? Everyone is on Facebook. IRC? What’s that? Those who know, many prefer using web clients. Your operating system isn’t important, everything runs in your browser anyway. See Google’s Chrome OS.

      That said, the current trend of progress is clear to everyone. Client-side content is obsolete. It’s everything in the web. In the “cloud”. Accessible everywhere, regardless of platform or location. It’s just there. You sync your browser settings among your machines, open bookmarks and press “King Arthur’s Gold” link. The game launches. It’s always up to date, bugs get fixed seamlessly along with new content being introduced without the users having to do a single thing. Everything works flawlessly.

      Well, we aren’t there quite yet but it won’t take long. Languages mature, things like Scala, Clojure, Groovy along with JavaScript and Google’s Dart will be THE thing in “content-based programs”, such as games. Perhaps Microsoft has their own C# dialects and Java has some frameworks, but I am not familiar with those. Mix in some WebGL(if it ever matures to a state of being de-facto standard) and you can do lots of hardware accelerated, good-looking shiny 3D things in the browser.

      It’s not so simple though, C++ and client-side software has a *huge* momentum behind it, and changes like going from desktop to the web take years, if not decades to fully migrate but the trend is clear. Either you focus on bleeding-edge stuff on the desktop, or focus on dumbed-down but working ideas and graphics on the web. I see KAG falling in the latter category so perhaps if it ran flawlessly in the browser, it would have *huge* potential behind it, *just* because it runs in the browser and works literally everywhere with absolutely no hassle from the user’s part.

      Oh, and I hate this progress. I still program lots in C and assembly.. for DOS. :)

    4. Desktop is not going to die anytime soon…

      “IRC? What’s that? Those who know, many prefer using web clients.”
      Definitely not.

      On topic: take the good things from the current engine (those which are well structured and which aren’t hacky, or at least very little so it’s easy to rewrite them properly) and use them to make the new one.

      Also, decide what to do with LD finally. If you open-sourced it (only the code, not the art), someone could make something great from it (for example I’d really like to).

    5. Reactorcore

      @Clawbug: KAG is definetely a good fit for cloud computing based setup because its an online multiplayer game, but desktop isn’t going to die anytime, if ever.

      For instance, privacy and user content (modding) aren’t really suitable for cloud computing based applications. And those are really big deal for some projects.

      Btw, MM, why don’t you like Java? I’m considering to develop a project of my own and I’m looking at C++, C# and Java as my possible choices for a language.

    6. I really doubt a browser environment would help as much as it would simply hinder by performance. I don’t think that unless your language of choice is Brainfuck should you ever consider switching away from your proficient language.

      I don’t simply do not know how complicated an engine has to be before you /cannot/ do something with it. But then, I’d imagine that plain refactoring could save you terrible amounts of work, even if it’s a bit risky.

      I’ll keep on insisting that you’re not being fair towards Link-Dead. /v/ just didn’t happen to take wind of it. IT. COST. MONEY.
      Not to mention the fact that lag compensation was introduced into the engine, what, a month ago? I personally feel that the game’s art style is rather lackluster, too.

      Said before, saying again: there’s genuine potential in there.

      We had a nice chat with Geti to- yesterday about super-KAG.
      I contributed mostly by making up funny procedurally generated magic spells. A staff of curse of bear rain could well act as an endgame artifact. But it’d also be so damn awesome.

      There’s definitely potential there as well.

    7. “For instance, privacy and user content (modding) aren’t really suitable for cloud computing based applications. And those are really big deal for some projects.”

      “Btw, MM, why don’t you like Java?”
      Scala is something like Java on steroids.

      IMHO: you should stick to c++ and go with the original plan. (that is: write new engine) It’s always nice, when from the very beginning you know, what you want to achieve, and you have the experience taken from developing current version of KAG.

      New technology = new problems. Writing such a big project on new platform, without proper experience, is downright sucidal. But that’s just my opinion. 😉

    8. I would love to see the second Idea with a second world war game or like a counter-strike type of game. I think the fact that you only have one live would add to the already “real-life” feelin gof the game. But since I stopped playing computer games I cant really tell if it would be fun with KAG too…

    9. Desktop as we know it will be dead. All the “Apps” will be web-based. The whole web will integrate to the “desktop” in the future. While traditionally your OS has run all the programs you’ve wanted to use, like your MSN client, IRC client, music player, web browser, games, office suite etc.. ..these days _ALL OF THOSE_ are on the web _already_! Meebo for MSN, Mibbit for IRC, spotify for music, games on multiple sites, office suite in Google Docs…. Not happy with those? Give it a few years and there will be tons and tons of alternatives.

      Why would anyone go to a website, download the software, (unpack it), install it(next, next, agree, next, next, *wait*) and then launch it.. ..when it all could be done in the first step? Just go to a website and it’s all there. Simple as fuck, no need for any nonsense. Anyone claiming that it isn’t important is lying to themselves. Look at Apple. All they do is take ideas from others and simplify them. Make them work without any nonsense. People are actually willing to pay ALOT for this.

      Anyone believing that a great majority of people care about their privacy is outright lying to themselves. Look at Facebook. How many million users? Look at how many people play games in Facebook? How many _million_ people simply don’t care about such issues?

      The amount of “modders” compared to the total amount of people who bought the game is what.. I don’t know the exact numbers but a huge minority. That minority is well worth the increased potential audience when moving to browser. You can’t please everyone, at least not yet. Nothing stops someone from providing tools to “mod” the game, save their “mods” and let others play them. No one just has done that _YET_.

      The biggest drag(a force resisting the movement) is that people are afraid of the change. That’s natural, technologies mature, people learn more, people adapt.. and before we notice, the whole setting has changed. That’s how it has always gone and that’s how it will always go. Of course we can’t just bring big games to the web. There’s absolutely no way to run modern 3D games in the browser yet. That is because of multiple things, for example due to the fact that e.g. even technologies like WebGL don’t run *natively*, they are translated and then ran natively. That will always be slower than direct OpenGL rendering which is way slower than DirectX. So GPU demands are higher. Most “native” games are programmed in C++, which is multiple orders of magnitude(like 1000x) faster than, say Scala or Flash. You can have thousands of times more content, better graphics, better framerates and so on on the “desktop”. However, _these are not necessary for a good game_! I claim, that for example, a game like Soldat could be ran on a browser if written well. The technology is well there. Though there are obstacles. No practical way of doing full-screen for example. Issues with lag, input lag and client/server sync are some problems. However, they will be overcame in the future, just as they were with the desktop.

      It’s all about attitudes. As we can see, there are people who don’t believe in this progress for whatever reason, even though they have been witnessing it themselves for years and there’s absolutely no reason for it to change anytime soon. Just as there are people who claim that PC gaming isn’t(going to be) dead, or that desktop PCs aren’t going to be the thing of the past. :) Sure, there are people who prefer sheer power over portability and price, but they are the minority. Just like those people who don’t want to move over to web will be the minority in the future once technology progresses and people adapt. There will always be people who are holding back. For example I still think that text-based command line utilities in the vein of UNIX-tradition are superior to your GUI desktops with shiny effects. I run my IRC client, MSN client, music player, torrent client, development toolchain(editor, compiler, assembler, linker, debugger) everything from the command line with absolutely no GUI bullshit. No mouse, everything works with keyboard shortcuts. However, I understand that 99.99 % people _don’t_ think that this would be good for them. Because this isn’t easy to get into. It takes months, if not years to learn to be proficient with. That is unacceptable for majority of people, which I well understand. As such, I also understand why people find it easier to visit their bookmarks with that shiny Firefox or Chrome to play that game for a while, or to edit those few files, or switch songs and so on.

      It is not about what YOU, or I want the future to be. It is about what the majority of people find _easiest to get used to_. No hassle, just click and go. Simple as that. Works anywhere, for everyone, anytime, with no hassle. To emphasize my point, I am not saying that your new shiny Battlefield 3 or CoD 5 or whatever is not going to be ran on the browser anytime soon. Huge AAA titles like that will _always_ run natively. However look at Minecraft. Look at Terraria. Look at KAG. No hundreds of developers working for years or no multi-million promotional campaings needed to be successful and earn your living. All of those could be ran on a browser these days, we just need people to get used to the idea and be willing to adapt. Give it a year or two and you’ll see a breakthrough.

      Why am I bothering with all this? It is because I genuinely believe that focusing solely on the desktop will not be practical soon. Perhaps it will be for the next 3-5 years and as such is not really a problem for MM for now, but being able to see how things change around you is vital in IT industry. Anyone can look at the growth of web technologies during the past 5 years and check out the jobs companies have open. It’s all about the web in the 2010’s, though the transition started years ago. Just like it was all about the terminals and mainframes in the 70’s and 80’s, GUI and desktop in the 90’s and 00’s, now it is about the web.

    10. Soldat fan

      Dude, why don’t you make soldat 2? listen, I’ve tried the new game, no offense but its shit mate, feels like a minecraft remake. I played the tutorial but didn’t play any more. What would be so entertaining about jumping and making bridges? Trust me, make a remake of soldat with better weapons and more ways of fighting, it will be far better than this game. Sorry if I’m blunt and rude but I’m giving you honest feedback.

    11. “direct OpenGL rendering which is way slower than DirectX”
      Oh yeah. Better learn the facts first and stop posting lies like this…

      The cloud will become a bigger part of our lives, the same as cellphones for example, but it won’t replace the desktop. You’ll use both and you’ll use the other things like cellphones, laptops and tablets too. They all have their place and use.

    12. Reactorcore

      @Soldat fan: Its not valid feedback if you didn’t play it in multiplayer. Saying what you did makes you look like the biggest douche on the planet.

      Give it a try again. Properly this time.

      @Clawbug: I see your point. There’s still a long way to go to fully make computers function server side instead of client based as it is now, but I can actually see it happening.

      The real hardware would be held in companies, along with all your files, information and other data. It would run your games, provide you internet, do all the real computing while you, the “user”, would be able to access this from a “terminal” device using a personal account, which can be anything from a mobile phone to a desktop.

      On the other hand, this will rape your privacy even harder then ever. Companies will practically have your PC physically in their data-center, meaning they own it and if you break any rules of theirs, they can easily shut down the service, leaving you with nothing. Or even give you to the authorities if you’ve done anything your government considers “illegal”. Kind of like Steam or Origin, except for the entire computer.

      I have to say this has some serious drawbacks that can easily cause people not to abandon desktops completely, thus preventing it from dying.

    13. There’s hardly reason to focus on optimizing base OpenGL implementations in the GPU drivers(because the OpenGL implementation is indeed part of the drivers) than there is to rely on the DirectX implementation by Microsoft and the GPU drivers from the manufacturer. This is partly a reason why OpenGL won’t be matching DirectX in rendering efficiency, because no one uses it in games. All the focus is on DirectX because it’s a de-facto standard in the (PC/XO side of the) industry. Though I’d like to hear your claims for OpenGL not being slower than DirectX. :)

    14. Certainly desktop won’t just “disappear” from computers. There will always be people who will use it. Just as text terminals haven’t disappeared, there are some of us *still* using and actually preferring them over shiny GUIs and such. However, that is not important. What is important how people generally feel about them and what people want to use. People don’t want hassle. 99 % of people don’t care about privacy. Look at Facebook or Google.

      All I am saying is that there isn’t much of a reason NOT to make your game web based, if you consider it an option right now. Yes, there are performance issues, lag issues, compatibility issues(as not every browser is 100 % identical). However, most of these are not serious. Most people don’t care about them *if the game is good*. As I said before, a game like Soldat is possible to be made run in the browser already. Someone just has to make it a seamless experience with no hassle. Just point your browser to and GAME ON. Simple!

      Perhaps in most “gamer” circles such “browser games” are considerd a joke, that’s for sure. But that is again because of people being afraid of change. People think that no *REAL* games run on browsers. :) But I have to admit that it’s not good either to be ahead of your time. People will resist everything new. Most will not adapt because something new is superior. They adapt because everyone *ELSE* adapts.

    15. Reactorcore mentioned Java. I too am a fan of Java and I think I will continue to develop in Java for desktop and web. I only use other languages if it’s required. Would love to know what MM thinks about Java.

    16. Making of Prince of Persia ebook
      I haven’t bought it, but you might be interested (and sorry for being off-topic)

    17. „The real hardware would be held in companies, along with all your files, information and other data. It would run your games, provide you internet, do all the real computing while you, the “user”, would be able to access this from a “terminal” device using a personal account, which can be anything from a mobile phone to a desktop.”

      People in mid 90s talked about it as it’s near future stuff. But it’s 2011 now and it haven’t taken off yet.

      „This is partly a reason why OpenGL won’t be matching DirectX in rendering efficiency, because no one uses it in games. All the focus is on DirectX because it’s a de-facto standard in the (PC/XO side of the) industry.”

      No one? What about Blizzard, ID, EA? DirectX isn’t crossplatform.

    18. Blizzard, iD and EA use DirectX as their main renderer with a fallback/compatibility renderer based on OpenGL which handles potential ports to other platforms.

      You can check out the games released in the past 5 years and count all the games which have ANY OpenGL functionality and realize that OpenGL in the game industry is like Linux in the desktop world, only the select few bother the hassle and others couldnt give a fuck. Useless for the masses, important for the loud few. Oh and Carmack himself prefers DirectX… …and consoles.

      Oh btw, Chrome 15 has a nice feature which lets you add interesting “apps” to the new tab page. Those apps are things like YouTube, Facebook, Google+, GMail and so on. This is exactly the future. This is what your desktops will become. No more installing hassle, just click and go! This is how games should be, you click the icon you want to play, no downloading, no installing, no bullshit. Just click and play, simple!

      I’d really like Soldat 2 to run on a browser, accessible to anyone, everywhere, anytime! Just click and go, you get to blast people away with that LAW without ANY hassle! Who can honestly say that they would NOT like that? I can’t think of a single negative reason against this kind of progress apart from the fact that it requires a working internet connection, which might not be available to some people. However, those people wouldn’t really be the target audience anyway, so itäs not a big deal in the big picture.

    19. „You can check out the games released in the past 5 years and count all the games which have ANY OpenGL functionality and realize that OpenGL in the game industry is like Linux in the desktop world”

      Mac OS gaming is rising rapidly, graphics/OpenGL stuff get constant updates. Steam is already there. Even MM is making a KAG port for Mac (I was shocked to know actually, in a good way).

      „Oh btw, Chrome 15 has a nice feature which lets you add interesting “apps” to the new tab page. Those apps are things like YouTube, Facebook, Google+, GMail and so on. This is exactly the future.”

      You must have some sort of local cached copy anyway (offline mode) to be able to use apps outside 3g/wi-fi networks. So it’s like (almost) the same applications but written in html5/css3/js. With no to little system integration.

      „No more installing hassle, just click and go! This is how games should be, you click the icon you want to play, no downloading, no installing, no bullshit. Just click and play, simple!”

      And people in 10 years after that will invent a new way to play games. Without constant „downloading content” messages, with good ping, with ability to play using wi-fi/bluetooth only… binary games, so exciting!

      HDD is slow, using SSD you can cut game loading time in half. Using internet connection — ??? Just think about internet-only (no files on the PC) MMORPG. Like WoW.

    20. Everytime I hear word ‘Cloud’, especially from people being not professionals in IT I am laughting a lot. Cloud Computing is definetly nothing more than virtualized hosting what we know very good for years now. There is no significant difference between cloud and hosting, so lets make it clear: Cloud Computing is a pure marketing and it is not a revolutionary paradigm. It doesn’t change anything to our lives. Forget about rendering heavy cpu loaded games in browser using Javascript&html5. Dont you remeber why interpreted languages had been beaten by fully compiled native apps. Nothing has changed here. JS & html is still so slooooow due to its nature. C# is cross platform among microsoft solutions: XBox, WindowsPhone, Win8, desktop. It is compiled to the semi-native assemler-like language IL, efficient enought to game developement. Except a few well known situations, it is memory leaks free. With c# you got XNA framework targeted to game devs.

    21. c’mon dude make a remake of soldat… why u dont use Unity 3 engine¿?
      is very powerfull and of course
      with it you can do “browser based-games” (see unity 3 webplay dev)
      is for 3d games but.. fuck you still can doing freakin’ awesome 2d games with it
      please take a look of the unity 3 features
      i know is a paid engine but fuck is pretty easy to learn and powerfull

    22. Niezwykle interesująca wypowiedź, gorąco polecam. Sądzę, że zainteresuje kogoś tak samo
      mocno jak mnie.

    23. I’ve been browsing on-line greater than 3 hours these days,
      yet I never discovered any interesting article
      like yours. It is lovely worth enough for me. In my
      view, if all webmasters and bloggers made excellent content material
      as you probably did, the web will probably be a lot more helpful than ever before.

    Post a comment.