Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 09 Jun 2005
Offline Last Active Today, 02:12 PM

#5219758 From scratch vs Unity

Posted by blueshogun96 on 27 March 2015 - 07:03 PM

I wrote my own engine for these reasons:


1. Portability: My engine needs to work on whatever platform I want it do.  "But Unity runs on everything, including <insert platform here>", it becomes a problem not being able to use your language of choice.

2. Licencing: No need to worry about licensing fees, which is great.

3. Optimization: Have you ever tried optimizing a closed source commercial engine?  It sucks because you can't do it.  Size optimization is one issue.  One issue I see people talk about when it comes to Unity is minimum binary size.  I already have a rather complex engine, and I can remove the complex components that aren't being used if need be.  My engine generates very large executables (15mb in general, but VS13 takes 3 minutes to optimize it down to roughly 3mb).  Sometimes, that's not desirable, especially if you are running on a platform with fixed resources.  Another is rendering.  Sometimes, I need certain functionality that Unity might not give me, such as GPU fencing, command buffers/lists, or direct hardware access on certain embedded platforms.

4. Custom needs: Unity can't do *everything*.  It does many things, but sometimes, a closed source engine can limit your game in some ways, sorta like above.


Reasons I don't use Unity (don't take offense to this, I'm entitled to my opinion):


1. I wouldn't be caught dead writing a game in C# (my preference).

2. Pride as a seasoned and experienced programmer; I'm not a n00b.

3. I don't like Unity, or the fanboys who can't do a dammed thing without it, and yet criticize those who write their own.


I'm also going to say this (and I've said it before).  When people hear the words "writing your own engine", they are immediately thinking "writing everything from scratch, hence re-inventing the wheel".  This isn't always the case, and in mine, definitely not.  My engine consists of multiple open source components with compatible licenses making it suitable for commercial projects.  You don't have to write everything yourself.  Let me give you a rundown as to how I chose my engine's components:

  • Tokamak for physics.
  • Stb for texture based ttf font rendering and ogg decompression.
  • Assimp and OpenCTM for 3D mesh parsing.
  • SDL for various portable solutions involving threading/synchronization, timing, OpenGL context management, input devices, etc.
  • Some misc code from the NVSDK used for debugging and other stuff.
  • NVIDIA's Gameworks SDK for lots of misc stuff, like the excellent open source and extensive math library.
  • NVTriStrip to "stripify" primitives.
  • jo_jpeg, a simple jpeg library I use for screenshots.
  • ezxml or irrXML for XML parsing.
  • Enet as a reliable UDP based networking client.
  • Angelscript for scripting.

What I have written is basically the glue to put everything together in a neat and organized set of interfaces.  Some things I wanted to write myself, such as an extendable 3D rendering, audio and input interface that supports Direct3D, core OpenGL, OpenGL ES, OpenAL [soft], FMOD, OpenNI, Leap, etc.  So putting this all together was done rather quickly, and done in about 2 months worth of work off and on.  You might say that "I don't have that sort of time".  Then fine.  Time is the most valuable resource, as it is not renewable, but it's also important to use your time wisely, and considering my needs, it was well worth it, (and no, I didn't do nothing but write this engine; I worked on it in conjunction with a planned title).


This isn't an attempt to belittle those who use Unity, it's my defense from those who act like they are better than me because I don't.  Do what works best for you.  I've chosen my path, and it works best for me.  If you need Unity or UE4, go for it.



#5219746 Windows mouse event handling (outside of the target window).

Posted by blueshogun96 on 27 March 2015 - 05:48 PM

Well, there's a story behind the reason why I chose [Free]GLUT, and kept it.


This was initially a prototype concept from an idea I had once before going to bed.  At the time, I just wanted to test it as quickly as possible plus it was an unseen benefit to be able to press a button, and the window changes to a borderless window the size of the desktop resolution.  On top of that, I originally wrote this for MacOSX, and I didn't know how to initialize OpenGL without it before then.  So, I kept using it.


For this game, FreeGLUT is fine.  For my engine (which this game predates and hence, does not use), I use SDL because it contains various functions for system related stuff, and I can also use Direct3D with it.



#5219719 Windows mouse event handling (outside of the target window).

Posted by blueshogun96 on 27 March 2015 - 03:49 PM

Eureka!  GetCursorPos followed by a call to ScreenToClient solved the problem!


Now I can finally get ready for my game's beta release on Windows :)


#5217531 Question about saved games

Posted by blueshogun96 on 18 March 2015 - 08:38 PM

Writing a game's save data to disk can easily be as simple as writing the contents of a structure to a .bin file.  That's what I do for my game(s).


Example (C/C++):

/* A carefully aligned structure holding your game save data */
struct savedata_t
   int level;
   int score;
   char user_name[16];

bool save_game_data( struct savedata_t* savedata )
   /* Attempt to create a new save game */
   FILE* fp = fopen( "mysave.bin", "wb" );
   /* If successful, write the data, and exit.  If not, return a failure */
      fwrite( savedata, 1, sizeof( struct savedata_t ), fp );
      return true;

   return false;

A game save can contain more than just variables, maybe something like a bitmap icon used as an avatar, etc. so you'd have to take alignment and formatting into consideration.


Another thing you could do would be to write some content to a .xml file then inject that and any other files necessary inside of a binary container such as a .zip file (which could have any extension desirable to mask that it's really a .zip file) so that everything is kept in one single file that can be read and/or written to easily.  That's my two cents.


Other than that, I totally agree with golergka.



#5215495 GUI Challenge

Posted by blueshogun96 on 09 March 2015 - 02:53 PM

nothing but complete idiots on here.




... you're obviously very new to this forum, aren't you?



#5209535 How do I fix this stupid linker error?

Posted by blueshogun96 on 09 February 2015 - 12:02 AM

Okay, finally fixed it (thanks to Bacterius).


Changed this:

LOCAL_LDLIBS := -lopenal -lGLESv2


To this:

LOCAL_LDLIBS := openalsoft/armeabi-v7a/libopenal.so -lGLESv2


Sorry for cursing, I spent far too much time dealing with Android stuff then getting actual stuff done.



#5208344 1997 game graphic files

Posted by blueshogun96 on 03 February 2015 - 12:28 AM

Maybe one of you knows how sprites were stored in 1997 or recognized the file signature.


For starters, keep in mind that you can't assume every DOS game uses the same resource file format.  Usually they are custom designed to keep the every day person from easily reverse engineering it because devs generally don't want their assets stolen, so you could be infringing copyrights here depending on your intent.  Keep in mind that there are some exceptions, but you certainly cannot count on those either.


If you're really serious about this, then you might want to start off with building good reverse engineering skills.  Start by getting a good .exe disassembler and get a good knowledge of how x86 assembly works.  If you don't know assembly, then there may be a rather steep learning curve ahead of you.  I bought a book about reverse engineering, and it gives plenty of examples on reverse engineering functions in x86 assembly and discovering how code on a low level really works.



#5207766 Programming

Posted by blueshogun96 on 30 January 2015 - 04:42 PM




Listen to her.  She knows what she's talking about.





That is the internet for you... Rule #37... the power of avatar images and game avatars. smile.png

Right.  I'm still amazed how many people (even staff) keep mistaking L. Spiro for girl, even though he's explained the story behind that sketch he drew multiple times.


Btw, to the person who just rated down that comment... Not to be a jerk, but FYI, given the above statement, please don't get it twisted.  I should have known that someone wouldn't catch the reference, and probably go "zomg misogyny"!  Or maybe I just wrecked someone's fantasy about L. Spiro being a girl. :)



#5207475 Programming

Posted by blueshogun96 on 29 January 2015 - 12:06 PM


Drop your project for your own sake and for the sake of the others working with you. It is not fair to them that their hard work go to waste just because their programmer (you) has no clue how to program but just decided to jump into the deep end foolishly thinking he could learn to fly before learning to walk.




But the advice on how to learn programming remains constant.  You still need to start with small projects and work your way up.


Listen to her.  She knows what she's talking about.



#5206520 Windows 10 and Cortana

Posted by blueshogun96 on 25 January 2015 - 04:49 AM

Okay, so I'm porting my game to Windows Metro, because I believe it will be pretty well suited for it due to it's mechanics and minimalist art style.  And of course, I'd like to target Windows 10 and take advantage of some of it's exclusive features, such as Cortana.  Now, I've never actually used any APIs for Cortana before and I'm still rather new to writing apps for Windows Metro, but I think it would be a rather nifty feature to use in my game.  So far, every example I find is for Windows Phone 8, which is great in all because I'm supporting that too, but nothing in C++ so far.  Every example uses C#, and that's not the language my game uses.


So my question is (for those of you who are actively dev'ing with the Windows 10 preview), are the APIs basically the same between Windows Phone 8 and Windows 10?  And where can I find the APIs for C++?  All I can find is C# so far.





#5206259 I am beginning to hate the IT and gaming industry.

Posted by blueshogun96 on 23 January 2015 - 03:30 PM

Okay, 17 interviews later, finally got a new job.  It pays rather well for a position that doesn't require immediate coding ($70k). 


I guess I just had a Vegeta moment for a while there.



#5205696 I am beginning to hate the IT and gaming industry.

Posted by blueshogun96 on 20 January 2015 - 10:00 PM

Guess I was wrong, I'm through to the next round.  Got lots of studying to do.



#5204861 Porting my game to Linux

Posted by blueshogun96 on 16 January 2015 - 10:07 PM

2. It depends, if you stick to the LSB(you have to statically link any non LSB libraries, or replace them with a LSB equivalent) your game will run on all LSB compliant distributions (Using the LSB SDK is highly recommended), if you don't it is pretty difficult to say, it will most likely work on most debian based distributions atleast.

Thanks, but what does LSB stand for?



4. Any other helpful bits of advice.

You'll want to learn how to package your game distribution up as a .deb package. This is by far the friendliest way for your users to install your game on Debian/Ubuntu/Mint.


Ah, so it's a .deb that is the package type.  I've gotten used to having the all in one functionality of Apple's .app package.


While I'm at it, Ubuntu has an app store, and I hear that it's not working (or harder than it should be to install) on Linux Mint 17.  One of my goals is to get this on that distribution channel.  Do Mint users commonly have this installed?



#5204851 Porting my game to Linux

Posted by blueshogun96 on 16 January 2015 - 08:06 PM

Recently, I've setup a VM of Linux Mint for the purpouse of porting my game(s) to Linux.  My game is already cross platform between Windows Desktop, MacOSX, iOS and Android/Amazon Kindle.  Now, I am quite familiar with Linux, but I've never dev'ed anything for it either.  So I was hoping to get a bit of advice from those who have done this before.


1. Will g++ suffice as my compiler?  My game uses C and C++.  I'm also a bit of a noob to makefiles...

2. Since Linux Mint is based off of Ubuntu (and in turn, based off of Debian), what Linux distributions will my game run on then?

3. My game uses GLUT (and I plan on switching to freeglut), do I have to install anything extra or does Mint come with this?

4. Any other helpful bits of advice.






EDIT: Figured out how to install freeglut, and got it working with g++ already.  That's a load off so far.

#5204167 I am beginning to hate the IT and gaming industry.

Posted by blueshogun96 on 14 January 2015 - 03:23 AM

Fair enough Mr. Sloper.  I guess I can't argue with that.


This is a non-gamedev position, and I still have no more interest in working for gamedev companies anymore.


By the way, in your "outside-of-industry experiences", did you work with a team (of indie developers, for instance?). I do think teamwork is effectively what makes a team productive. Someone with mediocre programming skills but excellent teamwork skills will still create better results than an excellent lone genius programmer.

Yeah, but nobody cared about it (Cxbx).  In fact, it just confused employers even more, so I removed it.