Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 14 Aug 2011
Offline Last Active Oct 12 2014 06:03 PM

#5177269 Good open source engine 2d?

Posted by dejaime on 31 August 2014 - 02:19 PM

cocos2d - http://www.cocos2d-x.org/
moai - http://getmoai.com/

I wouldn't recommend moai, because it is a tad too complex for beginners, it is designed to be used by more experienced devs.


+1 for cocos2d.


Just SFML? I read that for physics in 2d games I should use something called Box2d. Does SFML takes care of the physics too? Or just the rendering part?

SFML is a multimedia library that "handles" media, system specifics and input. This includes rendering, audio, listening to kb&mouse/gamepads, networking and more.



But that's it, it gives you access to these resources, but it doesn't do any simulation. This means it does no physics, no collision detection...


Box2D is also a library, but it is a simulation one (physics simulation to be precise). This means it cannot render anything it is simulating, it "just does the math". You'd need to interpret its behavior to make it useful. Definitely not meant for beginners. There are many more ways to create physics though, and for a 2D sidescroller Box2D would probably be overkill, unless it is a physics game.

#5174037 GML Code crash when pathing (memory problem?)

Posted by dejaime on 15 August 2014 - 09:22 PM

Did you try adding a minimum delay for the order? Like only allowing the pathfinder to work, say, 10 times per second for each entity (as in add a 100 ms cooldown to it)?


I really do not know anything about GameMaker, nor even what language it uses. In other words, this is a complete shot in the dark here.

#5173493 What software(libraries, apis) should i use for my game?

Posted by dejaime on 13 August 2014 - 09:31 PM

As for your first question, if you are sticking to C or C++, I'd also recommend SDL 2. It is extensively used in the games industry, as the main development technology or sometimes to port games to new platforms.


About the engine controlling your game, that is not really accurate. You can do whatever you want with an engine like Unity, it does not restrict your ability to implement the gameplay. Of course, if you need some super fancy features as an exceptionally accurate physics or lighting, you'd be in for a hard time; it's hard to see a case where Unity wouldn't suffice though.

Now, about the advantages of using it, it is not an easy analysis to do. You have to consider the price of the engine for your desired platforms. Let's say your game has only simple physics, maybe some neat lighting system and doesn't need all features from Unity, chances are you could actually develop a smaller engine with a much better cost (time-cost) than you'd have to pay for it (monetarily). That is really case-specific.

1) Ive only heard of SDL being used when Valve was porting a game over to Linux to handle input and windowing

I can name many commercial games made with SDL over the top of my head: Starbound, Prison Architect, Amnesia, Faster Than Light, Overgrowth, Second Life... Not to mention that PyGame, Löve2D, Cryengine and many other engines are actually built on top of SDL.


#5173375 Getting direct acces to vector<unique_ptr<My_Class>> but ther...

Posted by dejaime on 13 August 2014 - 11:07 AM

when i know exactly what i am doing or what i want

Do you? Early optimization is a problem when you do not. Believe me, when I am starting a program, I never know precisely what I want. I only really understand my needs when part of the code is done and possibly redone some bits here and there.


Considering that you'd be using a vector to simulate a map, you'd be wasting a lot of memory and, instead of letting the map care for itself, you'd be concentrating all its relocation to a single operation.


If your containers will really be as big as you say, that a map wouldn't suffice, believe me, your cleanup will halt the program for fractions of seconds, causing FPS drops and other issues. This can also affect your physics engine, by generating exceptionally big "delta times" for it to simulate with. In addition, searching the way you mentioned your lookup would result in O(n) complexity or higher (any empty slots would make it > O(n) ), while std::map has it O( log(n) ).


In other words, trying to force a vector into a map would probably result in a lot more work for something that performs slower and uses more memory.

Unless you have good algorithms to insert, remove and search (as a red-black tree for an example), or some neat mechanism to avoid runtime stalls when rebalancing and possibly an automated memory pool to control your vector... but that is basically recreating the map container.

#5172672 Questions on Advertising

Posted by dejaime on 10 August 2014 - 06:46 PM

You should take a look at this link that I totally did not get from jbadams' forum signature: http://clicktobegin.net/business/20-ways-to-advertise-your-game/

#5172666 Why every time I search for UDK I find this

Posted by dejaime on 10 August 2014 - 06:08 PM

UDK can be used for FPS or any other first person games. It can also be used for top-view strategy games, 3D platformers, or anything you want. People that say it can only be used for FPS are badly misinformed.


Take a look at the UDK showcase, I'm pretty sure there'll be plenty of examples of "not-FPS" games there.


Anyway, as Krasten said, UDK is probably too much for a simple 2D game. There are countless possible frameworks for creating a 2D game, from Mono and MonoGame to MOAI.


That being said, aren't survival horror games are mostly determined by the content fed to FPS engines?

I think he means survival horror like in Amnesia, that is FP but definitely not a S, differing from Killing Floor, as an example. In case you have never seen Amnesia, the game doesn't have any weapons at all.


Usually, these games are filled with puzzles and scripted scenes rather than hordes of enemies.

#5172651 Getting direct acces to vector<unique_ptr<My_Class>> but ther...

Posted by dejaime on 10 August 2014 - 03:36 PM

Aren't you better off with a map?

#5172557 "Focused" learning resources

Posted by dejaime on 10 August 2014 - 12:23 AM

My favorite books are Game Coding Complete, Game Engine Architecture and Programming Game AI by Example.


Notice that all three are C++ books, but a C# programmer could certainly benefit from them as well.


The first, Game Coding Complete, gives an intermediate point of view on game dev. It is great if you can code a tetris but get lost on anything bigger than that.


The second, Game Engine Architecture, is also an intermediate book, that focus on the architecture of a game engine (duhh). It gives an overview of how parts fit together, and is a good book even if you don't plan on writing an engine. This book doesn't go too deep code-wise though, some snippets here and there, but nothing you can really go source-reading. This book has a fresh new edition, I think it came out last week.


The third one (even though it is already 10 years old) is a great book to read when you want to implement some basic AI on your game. It is full of code examples, but everything is windows specific (10yo, wouldn't expect anything different). Anyway, it actually gives a good introduction to AI and also introduces you to messaging systems, ECS... the scripting section is not good though, it is badly outdated.


As an honorable mention, I liked the "The" Game Production Handbook. It doesn't have anything to do with programming but is worth the read.


If you want to, you can explore the GD.net books section. They have some referred amazon links for you to browse (I prefer the BookDepository.com personally).

#5170751 Protect Against Speed hack

Posted by dejaime on 31 July 2014 - 06:49 PM

Why have I never seen anyone asking "How do I implement in-game cheats?" in these forums?

#5170154 Web Programming Proffession [ Need Advice] -

Posted by dejaime on 29 July 2014 - 01:56 PM

In my experience, there are two options when working with web dev: get a job or go freelance.


Getting a job is probably easier if you have something to show, a small portfolio if you will. So you'd need to have something to show, and what I did was creating sites for my family's and friends' businesses, for free (3 websites, to be exact).


Going freelance is harder, not as safe as a regular job, but can pay better. I say can because it is not necessarily true, it can take months before you can really rely on it. You'd need a good portfolio as well, to show potential clients, and all the deadlines are usually defined by contract.


Still, as someone said already, PHP.

With PHP, you can go autonomous or get a job. It is still the most asked language on interviews for this kind of job. A lot of people make jokes about it, but it is still a strong standard.


Secondly, it is good if you can handle yourself with at least one CMS. Be it Joomla, Drupal, Wordpress, or any. Familiarize yourself with the CMSs and a free framework such as Joomla's Gantry and T3 or Wordpress' Sparky. It will help you get nice websites to deliverable states in much less time; especially if you decide to go freelance. That's how I do it. I use Joomla mostly.

#5168456 Allegro in CodeBlocks using MinGW - compiler/library version mismatch?

Posted by dejaime on 22 July 2014 - 02:19 PM

When I wrote that short tutorial I was using MinGW 4.8.1 myself; this shouldn't be the problem.


The obvious answer I could give you would be to download the Allegro binaries for MinGW 4.8.1, but I checked and they don't exist (these are community maintained, can't really complain).


The second obvious answer is telling you to compile Allegro 5.0.10 on your own instead of getting the binaries. Unfortunately Allegro is not an easy to build library, on the contrary, it takes a lot of time, needs some specific DirectX files and other libraries, a pain; go to this link if you want to give this a try.


Now, what you could really do is:

1 - Try adding the -fexceptions option to your compiler flags (right before `pkg-config --cflags --libs allegro-5.0 allegro_primitives-5.0` ), it's worth a try.

2 - Go to the www.allegro.cc forums and ask if anyone has the binaries for 4.8.1. The only time I had gone there for help they were really helpful.


Just as a side note, both Allegro and MinGW have new versions, MinGW is on 4.9.0 while Allegro has its 5.1 out (with a new API). I'd recommend going with both new versions even though they are considered unstable.

#5167727 C++ smart pointer usage

Posted by dejaime on 18 July 2014 - 09:40 PM

It is probably -std=c++14 or -std=c++1y

But you'll have to add it in the [Other Options] tab and unmark the -std=c++11 .

#5167724 C++ smart pointer usage

Posted by dejaime on 18 July 2014 - 09:16 PM

Well, that is weird. But you said you had 4.8 before and installed 4.9 manually?

You could check to see if codeblocks is really using the 4.9 version of g++.
There are two ways of doing that.
One would be to compile the code manually via console by copying the g++ command codeblocks uses.
A second possibility is to go through Settings-&gt;Compiler-&gt;Toolchain Executables(TAB) and click in the [...] button by the g++ command. That'll show you the folder where c::b is calling g++ from, you then go to that folder and call g++ --version in it...
...or C++11 does't have make_unique. I have to admit I haven't really used unique_ptr from the std. Will have to look that up for you.

Yes, C++11 really doesn't have make_unique. I should have known that! haha
http://en.cppreference.com/w/cpp/memory/unique_ptr (lists make_unique as a C++14 feature)
http://isocpp.org/blog/2013/04/n3656-make-unique-revision-1 (paper that got approved into the C++14 draft)


Apparently, my make_unique comes from boost, when I kill the link to boost I get the error. I used to merge boost with my std namespace to mimic C++11 years ago, and this is still biting me to this day every time I reuse that code.

#5167717 C++ smart pointer usage

Posted by dejaime on 18 July 2014 - 08:14 PM

I am also on linux and using GCC 4.9.
Are you using the automatic build system?
What about those "using namespace insertItHere;"?
Go through Project -> Build Options...
and check if you do have the flag marked as in here:

You can also check this by looking at your compiler output when you build your source. Something like this:
g++ -Weffc++ -std=c++11 -Wall -pg -g -DDEBUG -ITextureVault -Iinclude -c /home/dejaime/(...)

#5167711 C++ smart pointer usage

Posted by dejaime on 18 July 2014 - 07:10 PM

Just tested it with -std=c++11 and it is working.
Did you mark it for the entire project?
Have you #included <memory>?

I get an error saying it's not part of the std library.

It would help if you posted the error itself.