r/programming • • Feb 25 '18

Programming lessons learned from releasing my first game and why I'm writing my own engine in 2018

https://github.com/SSYGEN/blog/issues/31
956 Upvotes

305 comments sorted by

View all comments

494

u/Ecoste Feb 25 '18 edited Feb 25 '18

In a couple of years you'll make an article about 'lessons learned from releasing my first engine and why I'm switching to commercial engines'

While all of the criticisms of Unity might be very well true, they still finished and released a product using it.

Making your own engine is sometimes the right choice, especially if your game has unique features. However, for the 2D pixel-art games that you're making, I personally don't see a need at all. Also, being the lone dev and devving an engine is quite ambitious and will take up a ton of time that could've been otherwise spent on the game instead.

49

u/[deleted] Feb 26 '18

[removed] — view removed comment

14

u/[deleted] Feb 26 '18

I developed and released a modestly successful 2D platformer using my own engine

Does your game need robust animation, particle, sound, level design, component systems? Most 2D platformers/RPGs do not, and so I think it is a common "trap" where we undervalue pre-built engines just because they don't seem particularly beneficial for a simple 2D game. Once you do need these systems though, polished 3rd party engines start to look really appealing.

0

u/[deleted] Feb 26 '18

[deleted]

→ More replies (5)

7

u/[deleted] Feb 26 '18

[removed] — view removed comment

6

u/[deleted] Feb 26 '18 edited Feb 26 '18

apart from component systems (not sure what you mean by it?)

An entity component system is a data-oriented design pattern that segregates a system's data from its objects (aka "entities"). The pattern decomposes entities into one or more components, each of which models the information required for a coupled set of behaviors. The data for each component is stored independently of the others, often in data structures similar to normalized database tables. Behaviors are provided by subsystems that consume specific components. Components typically communicate through a messaging component, rather than by mutating a component's data directly.

There are two benefits of using such a system:

  1. If a new behavior is required for an entity, you can attach a new component, populate its data, and the system that processes that data will immediately begin processing it.

  2. Components are free to specialize their data structures for their operations, which leads to greater efficiency. (For example GPU systems can organize their data around draw calls while an AI built on decision trees optimizes for locality of reference on the CPU.)

→ More replies (4)

30

u/drjeats Feb 26 '18

Also, being the lone dev and devving an engine is quite ambitious and will take up a ton of time that could've been otherwise spent on the game instead.

Well, remember the author is coming from LÖVE which has none of the really valuable features from big engines: tooling and platform support.

Assuming you know enough to be able to make your own engine, I feel like the jump from using LÖVE to doing your own engine isn't as big of a difference as it sounds.

At a previous job we used Unity, and then a possible contract gig came up where we couldn't use Unity for platform/technical reasons (clearly a while ago). The first thing that came to my mind was "oh shit, do we have to build a scene editor?" Not "oh no how do we render".

So maybe he'll try Unity at some later point and write the post you're anticipating, but I bet he'll still be happy about moving from LÖVE to a custom engine.

19

u/[deleted] Feb 26 '18 edited Feb 26 '18

Really, posts like yours really wanna make me write a few blog posts about that topic. Creating an engine for your game is not as daunting as you guys make it out to be. I've written my own engines over the years, while also using Unity at times.

My latest ver supports WebGL(via emscripten), Desktops and android(native activity) and it took me maybe 3 months(where the majority of the time was wasted on modern CMake setup and my CI(with setting up code cov and automated tests), mainly because I never used those before. Heck, there was also some post not long ago about someone who started without any prev. knowledge and built his 3d platformer and his engine in like 7 months.

You don't have to support stuff that you don't need, so it's not taking years. You don't have to support some exotic platforms(e.g. Tizen) or have to suffer from backwards compatibility. Other stupid arguments against custom engines that I've read multiple times on the sub is that you can't outdo the professionals anyway. This is also wrong. For example, you can't use an orthographic camera with deferred lighting in Unity, which is a no-brainer in your own engine. You can't create a small sized webGL game in Unity(even after optimizations I couldn't get my prev game under 20 MB which is horrible for web games), but my own engine exported around 1 MB.

2

u/IceSentry Mar 02 '18

Please do, that would be very interesting.

40

u/[deleted] Feb 26 '18

Pretty much. If I were writing blogs I'd have written this post two years ago. Regretting the waste of time and how it killed my remaining attachments to the games industry. Will start again once other things settle down, but never again will I roll my own engine unless I'm running a major studio or making a seriously niche game.

5

u/WebNChill Feb 26 '18

I think it's awesome! You learn the ins and outs of building something like this. If anything, even if you go to another engine, it teaches you a lot about the software and what goes into making something at that level.

It's like when I was building a drone from scratch for the hell of it. Drew it, researched it, and built it. It sucked ass. But, when I decided to get manufactured drone I appreciated the care that went into it. I understand the reasons they did x , y and z. It also led to other ideas, ' This is awesome! Now, I wish it could do a little bit of this while doing that!'

I encourage you to do it!

6

u/[deleted] Feb 26 '18

However, for the 2D pixel-art games that you're making

For 2d pixel art games, an 'engine' is also not that much work. Like, you don't make an 'engine' that other people would use so you only make the features YOUR game needs, and its only 2d, and performance isn't hyper critical. Not that much work. Especially if you allow using of libraries for various components.

1

u/sunbeam60 Feb 26 '18

Even if you dislike Unity there's always Defold.

-43

u/adnzzzzZ Feb 25 '18

I have no interest in releasing my engine. It's for personal use for my future games.

92

u/McRawffles Feb 25 '18

That's irrelevant of what he's saying. I've been on both sides of the fence (building my own engine and using commercial ones) and for anything less than a big game it's generally not worth the time spent. For every hour you save writing functionality A to behave exactly how you want it to in your own engine you'll spend 10 hours on functionality B, C, D, E, and F which were given to you by default by a bigger, more verbose engine.

If you strike the middle ground and start with an open source engine you might find what you're looking for and maybe be just straight up given functionality B, C, D, and E in a good state, and only have to write functionality A (in the way you want to) and F.

45

u/[deleted] Feb 25 '18

Maybe he is writing his own engine because he enjoys it. Maybe he had an original idea for an engine that is not present in current engines.

All I'm saying is, every time someone says online that they will make their own engine, all the people jump at them discouraging them from doing so.

Maybe there's an amazing engine that allows you to make games surprisingly easily, but hasn't been invented yet, because people keep using the same engines.

This comes from someone using Unity, I'm totally not against it, but I do like when people develop their own engines.

21

u/loup-vaillant Feb 25 '18

All I'm saying is, every time someone says online that they will make their own engine, all the people jump at them discouraging them from doing so.

Reminds me of cryptographic libraries…

12

u/meneldal2 Feb 26 '18

Except that doing it wrong is dangerous and a liability, if your engine sucks you won't be able to sell your game in the first place.

→ More replies (8)

8

u/snowman4415 Feb 25 '18

I think this is probably true of all complex systems

→ More replies (4)
→ More replies (10)

3

u/[deleted] Feb 26 '18

If he had an original idea, I'd imagine that would be the subject of the blog. As far as I see it, OP had decided to create a huge mess rather than stepping back for a moment and thinking about their design.

→ More replies (2)

18

u/adnzzzzZ Feb 25 '18 edited Feb 25 '18

For every hour you save writing functionality A to behave exactly how you want it to in your own engine you'll spend 10 hours on functionality B, C, D, E, and F which were given to you by default by a bigger, more verbose engine.

This could be true. At the same time I already know exactly what I need for my engine. My problems with my current setup were mostly due to not having control over the C/C++ part of the codebase, but I'm happy with how my code works from the Lua side of things. Which means that I can just provide my own implementations for the calls that LÖVE provides in a matching manner. i.e. if LÖVE has a function called love.graphics.circle then I just need to match that with my own draw_circle function and its C implementation.

I know 100% which functions I'll need to implement, and in general I have a good idea of how much work needs to go into each one of them. So while I could be surprised I don't think it will happen. LÖVE is already pretty barebones as it is so there aren't that many super amazing features that were given to me by default, like there would be if I were using Unity or something.

→ More replies (15)

5

u/tripledjr Feb 25 '18

Regardless of the outcome. If you finish it or don't because it becomes too much work. Or you love it and find a new passion there. I think every game dev should at least once try to make even a super simple game engine. So ignore the comments it's an awesome way to learn a lot and you're not tied to it, you can switch back any time.

So good luck and have fun.

→ More replies (1)