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 29 Sep 2012
Offline Last Active Today, 10:19 AM

#5227816 Best engine/language for a ~2d golden sun/pokemon type game?

Posted by KnolanCross on 07 May 2015 - 12:05 PM

As people stated, there are some libraries that have better tools to help you.

I am personally a fan of ORX, which also a C engine and is data-oriented. It uses ini files to describe objects making changing things in you game much easier. It also support graphic effects* and particle effects, which is a great addition.

If you are willing to use python you can also use Pygame, which can be seen as a SDL adaptation for python. The main advantage (besides using a higher level programming language) is that there are literally thousands of code snippets that you can use.

* Basically a variation of one attribute of an object, for instance the classic monster blinking before dying is a variation of the alpha of the monster.

#5226498 Extremely modular software architecture: GOOD or BAD?

Posted by KnolanCross on 30 April 2015 - 07:30 AM

Not entirely on topic, but when you have an idea that sound good, you should probably do a very simple prototype. This will give you two notions:

1) Is the game really fun? A lot of times what seens cool on paper gets very boring and repetitive in the gameplay (in my experience, it is a fun mechanic to do once or twice, but a whole game with that mechanic is just bad).

2) It will give you a good notion of what and how you will need to code when you move to the actual game. Also, you can simply refactor some parts of the code and use them.

In time you will notice that you will be able to define a decent architeture when working on the project from the scratch and just improve it as it evolves. Also, may I notice that extremely generic code tends to be very confusing.

#5222987 Seemed easy, is really hard, How do you program bullets?

Posted by KnolanCross on 13 April 2015 - 12:38 PM

Are you using any physics engine? Maybe you could consider using one, I know that box2D has special behaviors to deal with bullets.

The only thing I can add to the discussion is that you need destroy the bullets even in case they don't collide with any other object (for instance, the player start shooting into the sky and there is no ceiling in your game). If you don't do this you will have performance issues sooner or later for handling hundreds of bullets that are traveling "to the infinity and beyond" =)

#5217337 Game engine for Linux?

Posted by KnolanCross on 18 March 2015 - 07:25 AM

I guess you need to give more info about what kind of engine you are looking for.


Most 2D engines will run on linux, as for 3D the open source ones tend to run as well.

#5214930 PathNodes: array or list

Posted by KnolanCross on 06 March 2015 - 05:42 AM

Assuming you are talking about A*, you will use more than one container for the pathfinding, you will need one to represent your scenario, one for the open list and one for the closed list.


The simplest solution is to use a grid to store your nodes and represent your scenario (assuming all your nodes have the same area size), where node of position x, y can be directly translated to the grid x, y index. A grid has two problems, the first one is that it will use a lot of memory, the second is that you will have a lot of nodes.


The best container to keep an open list a heap, since it will always recover the node you need in O(1), inserting an element in a heap is a O(log n) operation. Just keep in mind that you will need a modified heap, as you need to update the node cost (you can also update the values and call the heapify operation, if your implementation allows it).


For the closed list I like to use a list and a flag in the node, once I add it to the closed list I mark the flag and add it to the closed list. This approach is good because the only information you need for the closed list is if the node is in it. In the end of the pathfinding I go through all the elements of the list, reseting the flag.

#5211949 Problems implementing A* - Need a knowledgeable eye to look at my code

Posted by KnolanCross on 20 February 2015 - 12:33 PM

My point is, why on diagonals you add the current->getGcost(); and not on straight lines. Also, you never reset this value/set it to a initial during your whole neighborhood loop.


At least in my implementation I always SET it nodeG + the distance between the two nodes. I don't add it to a buffer, hence I use "=", not "+=".

In you implementation it seems to me it should be:

if (corner){
    newGcost = current->getGcost() + 14;
else {
    newGcost = current->getGcost() + 10;

Again, I may be wrong here, but the way it is in your code really didn't made sense to me.

#5211945 Problems implementing A* - Need a knowledgeable eye to look at my code

Posted by KnolanCross on 20 February 2015 - 12:17 PM

I just took a  quick look, here are the bad smells I could find:


Not using it, but here should be h:

    int getHcost(){ return g; }

I could not understand the logic of yout newGcost update, maybe you should double  check it.

#5210445 Very basic 2D RPG game

Posted by KnolanCross on 13 February 2015 - 05:04 AM

Google for (those requires nearly no coding skill needed):

- RPGMaker

- GameMaker

- Construct2


If you want to code the whole game, I would suggest that you start here:



Very well written step by step tutorial using pygame. As for graphics, if you don't want to release your game (personal game or just show to a few friends) you can get the ripped sprites from google (just google for pokemon sprites). If you want to release your game, then you will have to find some free sprites, opengameart is a good place to start.

#5200049 Success Story, need advice from here

Posted by KnolanCross on 26 December 2014 - 06:35 AM

What I would do is offering a small amount of in-game currency and some in game item that have a reference to my other game if people download the other game. The item must not be powerful, but it should be fun or goofy.

For instance, say your famous game is a racing game and your new game is a pre historian game. Give players of the famous game a tyrannosaurus' roar horn for downloading the new game.


IMO, that would get people curious to play your new game, which wouldn't happen if they got only in game currency (in which case they would likely to download the game, get the reward and never touch it again).


That being said, keep in mind that I am not a famous game developer, this opinion was born of my experience as a consumer.

#5197557 Using python for mobile GameDev

Posted by KnolanCross on 11 December 2014 - 06:39 AM

I have been using Kivy for one year now for a scene editor and I would not recommend it for a game.  It is a great UI framework and I really like it, but it is not a game engine. You won't have many useful features (for instance, collision detection) and you won't find many topics on specific game problems.


I would stick to pygame if I were you.

#5197544 Help with 2D pathfinding

Posted by KnolanCross on 11 December 2014 - 04:09 AM

I have a simple A* implementation in C in my long dead blog:



It may be useful.


There are 3 paths you can follow (no pun intended):

1) Use a grid + A*, consider tiles where an enemy is as not walkable, recalculate each frame. This is the slowest* one possible, but since your map is pretty small, I don't see it being a problem. You can also easily optimize it by saving creating a grid "version". You start the grid as version 0, each time it changes you update the grid version. Save the paths with the information of which map version it was created, if it changes, you need to recalculate the path.

2) Use a grid + A* to find the path and then use steering behaviors to keep enemies from colliding.

3) Use only steering behaviors. You can set the agents to avoid the static objects, but in my experience, it is very annoying to get the weights right.



* PS: Please notice that for a lot of games, the "slowest" path finding solution is still fast enough. Heck, I have used floyd-warshall (which is away slower than A*) in some prototypes in the past and it was fast enough.

#5189744 Current state of custom and commercial game engines as of 2014

Posted by KnolanCross on 28 October 2014 - 12:29 PM

So, one of my questions is, is it worth still to make a custom game engine for yourself or even to think about making it open source or commercial ?


Very unlikely, forking an open source engine to make your own may be a good idea, but I can't really think of a good reason to do so, also many have licenses that would forbid that you add features without releasing them as open source.


The point on this whole topic is that it has been a long, long time that people have started developing engines, so they have a giant upper hand against anyone who wants to start now. I support open source engines and am quite active on development of tools, tutorials and answer question to the one I like (shameless hook: look at my signature to check the engine), but I am very aware that if I wanted to create a serious game (to earn money to keep myself alive, not as hobby) I wouldn't go for an open source solution, specially if we are talking about 3D.


As for your own situation, I think this is the best time ever for you. Since most engines work with plugins, you can definitelly work on a commercial plugin and make a decent amount of money with it.

#5189736 UnboundLocalError: local variable 'comp' referenced before assignment

Posted by KnolanCross on 28 October 2014 - 11:43 AM

No problem.

pc=comp() & whowin(you,pc) will work.

But keep in mind that there is no need to save characters, you could rename the comp function to something like get_computer_hand.


Finally, there is a program called "pyflakes" that will check for errors, you could use it: https://pypi.python.org/pypi/pyflakes

#5189712 UnboundLocalError: local variable 'comp' referenced before assignment

Posted by KnolanCross on 28 October 2014 - 09:43 AM

1) You have a function with the same name of a variable, which is a very bad idea.

2) You should check the user input as soon as it is entered, not after you processed the round.

3) You can replace the second end third ifs of the comp function by if, elif and else.

4) The parenthesis of your whowin function are wrong, here is an example:

>>> comp = "rock"
>>> you = "scissor"
>>> comp == ("rock" and you == "scissor")

What python is interpreting in this code is:
"rock" == (bool("rock") and you == "scissor")
"rock" == (True and True)
"rock" == True


you probably meant:

(comp == "rock" and you == "scissor")

#5176814 Include file not found in GCC, due to path size?

Posted by KnolanCross on 28 August 2014 - 08:55 PM

You can also set the paths in the include search path of code::blocks. I use to do this in my linux/windows projects.