Jump to content

  • Log In with Google      Sign In   
  • Create Account


Game Engine from Scratch...Why?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
30 replies to this topic

#1 SharkBaitHooHaHa   Members   -  Reputation: 271

Like
1Likes
Like

Posted 04 May 2012 - 08:04 PM

Hey I haven't posted in a while, but a question just popped up in my mind:

Why do people want to make game engines from scratch?

I ask this mainly because when I started out programming(I still remember my first post in these forums lol) I wanted to make everything by myself; I didn't want to use any libraries(although to be completely honest, at the time I doubt I really understood what a library was). I eventually got over that, as I've been programming for a bit longer now. I've been working under the tutelage of a mentor for a school project to make a video game in Java, and so far I've been able to make my own game engine and I am in the process of finishing up the last bits of the demo, but of course through using the Java API(mostly just using AWT and Swing).

However, recently I was reading some articles and although I'm generally not one susceptible to being influenced by heavily biased works/articles, I did read one that made me think a bit. It was talking about using different languages to program. I started out with C++ (which I'll admit, I did against the advice of others, and somewhat regret) but after about a week or two, I switched over to Java. I started out learning using The New Boston's tutorials on YouTube, and once I finished Bucky's video series, I bought a book on Java, and then another, and then another...... basically I amassed a giant stack of books on programming languages. Recently, I got a mentor for my school project, and I now feel very confident in the language, but what the article said struck me:

Programming in Java is largely looking for the right API, learning how to use it, implementing it, and forgetting about it until it is necessary again.

I'll admit that for a second I cringed, because I felt that the time I had spent learning the language had been reduced to something akin to learning how to use GameMaker or RPG Maker. For the past week or so I stopped programming in Java and fell into a sort of "programming depression" in which I was desperately searching through my C++ books to try and learn it again and see if I could make a game engine from scratch, without relying on any APIs. I essentially wanted to set out and make the wheel again. At first it was just simple stuff as with how to do active rendering, but then it got really ridiculous when I felt "ashamed" of using even the BufferedReaders in Java to handle file input. It felt really greedy to want to know how to do everything, and I'm sure given another couple of weeks I probably would not be satisfied with anything less than making my own computer from scratch so I could make my own game from scratch.

I'm trying really hard to force away this urge to do everything from scratch so I can go back and work on my project again without feeling like I'm doing something morally wrong. Has anyone else been in this situation? Is there anything inherently wrong with being high-level vs. low-level with respect to games?

Sponsor:

#2 ApochPiQ   Moderators   -  Reputation: 14664

Like
5Likes
Like

Posted 04 May 2012 - 08:27 PM

It all depends on what you're trying to accomplish.

If you want to make games, use any tool available that helps you realize your goal. There's nothing "wrong" with that at all; it's actually the smart way to get things done.

On the flip side, if you want a deep understanding of game technologies, building them yourself is a reasonable way to learn about them. There's again nothing wrong with this as a goal, but it does somewhat run counter to the goal of building games (by yourself anyways; if you have a large team you can afford to be a technologist and not much else).


So the real question is, what do you want to do?

#3 SharkBaitHooHaHa   Members   -  Reputation: 271

Like
0Likes
Like

Posted 04 May 2012 - 08:55 PM

That's something I was also thinking about. I think I just want to know how everything works. I would be perfectly fine using a File I/O API once I understood how it worked. I guess I just don't feel very comfortable going about using "black boxes" unless I know how they work, or I built them myself :P

For the short term of creating my game for my school project, Java suits me perfectly because I am very familiar with it, and it provides me with an API that I can use to get the job done, but eventually I want to understand how everything works rather than solely relying on the fact that "it just works, use it". So again, I guess it's just me being greedy about knowledge but I don't really know how to go about attaining it, since I know a lot of those things are accomplished at the operating system level. Is there a practical way of going about learning all those low level techniques without having to go all the way to the bottom(coding in Assembly or lower possibly)? By the way thanks for the fast reply :]

#4 jbadams   Senior Staff   -  Reputation: 17720

Like
2Likes
Like

Posted 04 May 2012 - 08:59 PM

Would it make you feel better to know that a lot of commercial games use existing engines rather than creating their own technology? Just take a look at the list of games created with Unreal Engine, id Tech 3, and id Tech 4, amongst other engines that are used commercially.

As ApochPiQ says above, it all depends what your goals are -- if you want to learn about the technology behind games then creating your own engines can be a valuable experience, but there's certainly no shame in doing the smart thing and using what's already provided. There's simply no need to spend time recreating what others have already done if your goal is simply to create a game; if your game is good and isn't an undue hassle to play players won't care how you made it, even if you used something like Game Maker.

#5 L. Spiro   Crossbones+   -  Reputation: 12873

Like
4Likes
Like

Posted 04 May 2012 - 09:20 PM

I make game engines from scratch because I intend to make a middleware company and because it is my job.
It’s nice being paid to do what you would be doing anyway.


But making engines from scratch is not for everyone, and certainly not for you. You’ve made it into a moral dilemma.
I’m just not sure why you asked us for advice, though.

You already know what you want more than we do. We all do what we are in the mood to do.
Sometimes that is to make a game, sometimes it is to make an engine and explore technology.

You will start making games, or whatever you want to do, when you get into the mood to do it. That is just how it works.
It is like you are asking us to convince you of what you want.

Well, I don’t know what you want.
Why don’t you just do a bunch of different things and decide what you want?


L. Spiro
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#6 SharkBaitHooHaHa   Members   -  Reputation: 271

Like
0Likes
Like

Posted 04 May 2012 - 09:47 PM

Adams:

Haha thanks, I had forgotten all about those engines even though I have the UDK on my computer :] I guess you're right, now that I think about it the average gamer doesn't really ask himself what language the program is coded in or what materials were used. What I think I'll do is split up my time between writing my game on the engine I wrote, and then time on actually adding features/improving efficiency on my engine. Thanks for the reply!

Spiro:

I was just wondering if anyone else had felt that way at that point, or if there was any reason as to why I should go lower level. I understand that there are many performance improvements to be reaped from using low level languages. And excuse the hyperbole, I don't actually feel that it is morally wrong to use engines like Game Maker or RPG Maker, I guess I just don't like them because of a previous experience. Someone at our school used Game Maker to make a game for his project, and for the class demo we did (my friend and I both did Java games), we got lower marks in comparison to his game because we showed "lesser understanding of the material". But that's beside the point. I like working on my engine because it's challenging and I get to learn more about how things actually work, and then I like to work on my game(s) because it's just plain fun :] But I guess you're right about the mood thing. I think the issue was that I got sucked too far into including everything right away into my engine instead of focusing on my game. Right now my engine supports parallax scrolling which I'm not entirely sure WHY I included it when I'm doing a top down game...

Like I said to Adams too, I guess I just need to separate the two so neither my work on my games nor my work on my engine suffer too much :] Thanks for the input!

#7 slynk   Members   -  Reputation: 144

Like
1Likes
Like

Posted 04 May 2012 - 10:39 PM

Question is, why stop there? Why not write your own language? Or why are you coding on an OS that you didn't build? Aren't you using someone elses's device drivers to use your computer to program? At some point you have to reliquish control and just rely on other people's creations for the sake of productivity. There's nothing wrong with researching it, as long as it doesn't hinder your other projects (which in your case, it sounds like it is.) I myself on wims will research how a linux kernel works, or how device drivers work, etc. But I don't let that curiosity force me to stop production until I fully understand the technology behind what I'm using.

#8 SharkBaitHooHaHa   Members   -  Reputation: 271

Like
1Likes
Like

Posted 04 May 2012 - 11:13 PM

Haha, thanks Slynk! You're right, and even if I did build my own computer, I'm still using pre-built parts at some level. Guess there really is no point in re-building the wheel aside from learning. I will definitely take that advice and separate the research aspect from the actual project aspect of programming :] In fact I actually feel more motivated to go back and finish my project now. Thanks ApochPiQ, Adams, Spiro, and Slynk. You guys gave me some helpful feedback!

#9 frazchaudhry   Members   -  Reputation: 1129

Like
0Likes
Like

Posted 05 May 2012 - 01:54 AM

just a question. Why do u regret starting out with C++. I ask this coz I'm a beginner at game development myself and have started learning C++. I have had previous experience with other languages like VB .NET, ASP .NET, SQL, and HTML so im not entirely new to programming itself. So far im enjoying C++, so I just want to know what is it that made you regret starting out with C++

#10 SharkBaitHooHaHa   Members   -  Reputation: 271

Like
0Likes
Like

Posted 05 May 2012 - 02:19 AM

It's not that I don't like C++, I'm going to be looking more into it after I finish this project. It's one of the languages I want to have under my belt (Java, C++, Python, LISP, Assembly). The only thing is that with the book I was following along with, by the time I got to pointers I got really really confused. I guess the only thing was that I was not ready at that moment for that concept. The only time previous to then that I had ever programmed was in the 6th grade when I picked up a book for beginning flash game programming, but then I was only really copying out of the book(I have strong grasp on ActionScript now but I don't really use it). I don't know if it was me, or the book, but the way I went into the topic probably wasn't the best for my learning. Then I went into Java and having already studied the basics of C++, the transition was smooth and then I guessed the momentum just carried me through to where I am now. I think it was only the approach I took to learning it that I regret. I should have probably started with a friendlier language but in the end it didn't really affect me too much so I wouldn't worry :]

I'm not a veteran on programming by any stretch of the imagination. I've only been programming for about a year and a half now, and although I'm pretty decent at Java now, there's a lot more that I need to learn, and as such I'm probably not the best person to ask for advice :P But yeah, I wouldn't worry about it, I think it was just how I was going about it that messed up the experience for me :] hope that answered your question, lol I didn't mean to make C++ seem like a bad thing, it's a really cool language.Good luck with it!

#11 Sh@dowm@ncer   Members   -  Reputation: 122

Like
0Likes
Like

Posted 05 May 2012 - 03:54 AM

When making something like a game engine from scratch. It really means just having a language and a library and building your engine on top of it. As opposed to using a completed engine. You cannot possibly understand the inner workings of your program because there is always a layer beneath what you see. You can however for example choose a open source library so that you can figure out how it works if you want (but its works on top of OS library). C++ and Java are excellent languages for your "from scratch" approach. As opposed to using Engines such as Unreal or Unity.

Also note that i don't recommend learning C++ without learning C style coding. I'm not saying you should learn procedural programming first, you can learn java OOP first. But when it comes to C++ you should start from the beginning in order to fully utilize the full power of C++. Good luck

#12 Alonjar   Members   -  Reputation: 102

Like
0Likes
Like

Posted 06 May 2012 - 11:08 AM

If you are coding the engine simply because thats what you want to do... then awesome, do that. For everything else though, I'd say that re-writing code that already exists is a huge waste of time, I re-use as much code as possible at all times (whether its personal, or sourced from public).

#13 AdrianC   Members   -  Reputation: 602

Like
1Likes
Like

Posted 06 May 2012 - 11:33 AM

Until recently I also had the same mindset, I wanted to code everything from scratch. I think it was just so that I could say "Yeah I coded this game myself." and using an engine seemed like cheating to me. Then I picked up Unity. Its the first engine I've used and I'm definitely enjoying programming a lot more right now. I can get things done much faster by writing a lot less code.

#14 jbadams   Senior Staff   -  Reputation: 17720

Like
1Likes
Like

Posted 06 May 2012 - 07:39 PM

I understand that there are many performance improvements to be reaped from using low level languages.

While this can sometimes be true, it may not be as straight-forward as you think. Lower level technologies offer you finer control over your software, the potential performance benefits can be gained from using a solution that is more specific to your particular problem rather than something more general that has been created to handle various different problems. These potential advantages are far from automatic however, and it's entirely possible (even probable for a non-expert) to instead create a less optimal solution.

In the case where you've done a particularly good job of choosing your higher level technology and it's a good match for your specific problem, you would even find that you would simply have to replicate exactly the same solution if you decided to work at a lower level.

Choosing lower level technology (whether that be language, library, engine or whatever) hoping for performance reasons is not a good idea unless you have the experience to be able to take advantage of that. You should also consider whether or not the potential benefits will outweigh a potentially significant increase in development time.



As for learning a bit more about how things work at a lower level, I'd recommend taking a class or checking out some reading material on algorithms and data structures. You might also consider learning some basics of how simpler hardware works, and learn a little bit about assembly.

#15 SharkBaitHooHaHa   Members   -  Reputation: 271

Like
0Likes
Like

Posted 06 May 2012 - 09:41 PM

-AdrianC
Haha! We have the same name and same situation? :P I also have Unity, I picked it up when they were giving away a free license i think about a month ago? However I haven't looked it at yet, but I've seen some pretty cool games people have made on Ludum Dare on Unity.

-Adams
That's true, I can't wait for the fall when I start college and my computer science classes. For the past year and a half I've only been working with books, tutorials, and just recently my mentor. I'm going to be taking a C++ class instead of a Java class though since I feel comfortable enough with Java for the time being, and also in reference to Sh@dowm@ncer, I want to learn how to code in C++ since I'm sure I'd just try coding with C++ syntax in "Java style". Also I'm guessing that the lower level I go, the more probably I actually break something right? Yeah, I can't wait for my college courses.

-Alonjar
Yeah, so just "make things from scratch" for knowledge's sake, but when working on a deadline embrace pre-existing code right? I guess that makes a lot more sense xD I'm going to stick to that mindset from now on.

Thanks for all the feedback guys!

#16 jbadams   Senior Staff   -  Reputation: 17720

Like
1Likes
Like

Posted 06 May 2012 - 09:51 PM

Also I'm guessing that the lower level I go, the more probably I actually break something right?

Absolutely -- with great power comes great responsibility. Languages like C++ assume the programmer knows what they are doing, and if that isn't true you don't have some of the safety nets that other languages can provide. In the hands of a skilled programmer this means they have increased control and can potentially gain some performance improvements by tailoring the programs behaviour to exactly suit their own needs and not waste time trying to handle more general cases that don't actually apply. Unfortunately, in the hands of a beginner it means there are more potential mistakes to be made, and more you need to be aware of to avoid said mistakes.

It sounds like you're probably on the right track, and if you're planning to study computer science at college there should be some classes available that will teach you about some of those lower-level topics you're interested in.

Yeah, so just "make things from scratch" for knowledge's sake, but when working on a deadline embrace pre-existing code right?

Absolutely, that's an excellent approach to take. It's great to learn new things, and knowing more about how things work at a lower level can often improve your skills even when working at a higher level, but if you want to produce good quality software without wasting a lot of time there's absolutely no reason you shouldn't take advantage of existing technologies that meet your needs and have already been bug-tested, etc.

#17 jefferytitan   Crossbones+   -  Reputation: 1956

Like
1Likes
Like

Posted 06 May 2012 - 11:05 PM

What about a compromise? Use the high level APIs, but if one piques your interest do a bit of a google about how it works, maybe write some code to test it's capabilities. I think it's great to understand varied topics like pipelines, shaders, rasterisation, etc. But realistically you're unlikely to write a better implementation than the guys who write APIs for a job unless (a) your requirements are very specific or (b) they dropped the ball. Option b does happen sometimes, e.g. there are library implementations of quicksort which have worst-case performance for sorted or reverse-sorted arrays because they use the first element as the pivot.

The other option is to do some general research on known algorithms to feed that knowledge hunger, e.g. look up stuff by Knuth or Sedgewick. How string searching can be done is actually quite fascinating! Also design patterns are good to research, and often useful in future development.

#18 www.gamegugu.com   Members   -  Reputation: 73

Like
-8Likes
Like

Posted 07 May 2012 - 01:24 AM

It is a big project to making a game, especially a 3D game, but no matter how big or complicated it was, it can be separated to many different parts, some parts you need to concern since they are connect to your game idea closely, some parts you don't need to concern if someone has finished them for you, that's why people need a game engine, it can save your time and energy largely. But if you want to learn more or enhance your program skill you can also do everything by yourself.

Java is a good language for someone who is just a beginner of learning program, but it dose not suit to making game because its high level and low performance.

#19 jbadams   Senior Staff   -  Reputation: 17720

Like
3Likes
Like

Posted 07 May 2012 - 01:42 AM

Java is a good language for someone who is just a beginner of learning program, but it dose not suit to making game because its high level and low performance.


The creators of Minecraft, RuneScape, Puzzle Pirates and Wurm Online (amongst others) would probably disagree... Java is just fine for games, and whilst it isn't for everyone there's absolutely no reason to spread nonsense about it being "not suited to making games". The fact that it's higher level is potentially a good thing (as has already been covered at length in this topic), and while there can be some additional performance concerns the idea that it's "too slow" for games is largely just out-dated and no-longer relevant.

#20 mhagain   Crossbones+   -  Reputation: 7594

Like
2Likes
Like

Posted 07 May 2012 - 07:52 AM

Well somebody has to write a game engine from scratch. If you look at the previous examples of idTech3, Unity, UDK, etc - yes, they did get a lot of subsequent reuse, but they all began as engines written from scratch. If nobody wrote an engine from scratch these wouldn't exist to be subsequently used by those who don't want to or need to write one.

So you need to sit down and think about what exactly it is you want to achieve. Where is the payback for you? If you want to make a game then reusing an existing engine is likely to be a good option. If you want to learn about some specific aspect of technology, then modifying an existing engine might be more appropriate. If you want to get deep involvement in all aspects of what an engine does, then writing your own may be what you want. But it's firmly a horses-for-courses decision, and only the person making the decision really knows which one is right for them.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS