Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Member Since 27 Jun 2001
Offline Last Active Nov 27 2014 08:57 PM

#5194824 Some help with creating a Street Fighter style Beat Em' Up game?

Posted by BeerNutts on 26 November 2014 - 02:06 PM

In my mind such a game can be made to be quite simple.


If you limit the game to one kick move and one punch move per character, two characters, and one special move per character this is within the reach of any person new to gamedev and possibly only as complicated as maybe something like Tetris or at most a simple platformer.


You could also keep the animation frames to a minimum, use existing graphics from free resource sites to get the ball rolling, and this would give you something to build off as you learn.


The main thing is to remember the age old adage "Keep it simple". You can always make incremental changes to your game after you have something working, rather than trying to do everything all at once. Big plans up-front are a dinosaur from the past for most developers and agile methodology can be applied (google it if you're not sure, Tbshirk) which makes game development much easier.


Please let me know if you have any questions!


I don't really agree with you here, nor do I see any advice for the OP to make this game.  How do you propose a brand new programmer make SF2 clone as his 1st game?


If you're brand new to programming, then you're just not going to be able to make a SF2-type game right off the bat.  You need to understand the basic of programming 1st, then understand how games in general can be programmed, and doing simple, no animation-type games with a single screen is a great start.  Pong, Breakout, and then you can throw in some animations when you get an idea how animation works.


Python and pygame should be fun to program, and fun to learn to make games.


Good luck and have fun.

#5191660 Trouble with 2D collisions

Posted by BeerNutts on 07 November 2014 - 07:14 AM


I am fine with the collision detecting, there are tutorials all around internet about that, but they don't explain what to do after. 


Because it depends on what you want to happen after that. The effect most people are looking for is probably just to stop right before "entering" the object. Or you could be sliding along the object (more common). Basically if you have your movement vector v, you can alter it so that you do not enter the object. Example: sphere to box. Let's say that you move towards the box and hit it at some point (let the box be aligned with the main axes) by moving (Vx,0,Vz). If the box is exactly in front of you, you should alter your vector, so you do not enter the box - the easiest is to remove the Vz component, or somehow even add some part of it to Vx. And here's where the collision normals come into play. Let's say you collide into a triangle. This triangle has a normal facing out of it - what you could do is remove all contribution from your movement vector in the opposite direction of the normal. That is done by new_V = V + n*dot(-n,V)/(length(n)) (unless I m writing bs tongue.png  - happens pretty often to me).

Or you could make it so you bounce off the triangle - new_V = 2*(n*dot(n,-V)/length(n))-V


P.S. Seems I did write some bs yesterday - fixed - the new_V should be correct now.



This is not a very helpful response IMO.  The OP is asking for a 2D solution for a tile based game, and the OP is asking in a beginner's forum.  You're response is for 3D objects (sphere and box), and covering subjects that are going to be way over his head.


Unless prompted, in the "For Beginner's", I suggest following the KISS principle (Keep It Simple Stupid).


OP, I would follow what Buckeye suggested.  Move your objects, then test for collision.  In fact, to help determine which direction the collision occurred, I would suggest moving along each axis and checking collisions, and just revert the axis movement if collision occurs.  


This allows you to do things like jump and slide up against a wall, instead of just stopping all movement (vertical and horizontal) if you're jumping up and right, and hit a wall on the right.

#5187691 Can you give me an example shows the meaning of the concept?

Posted by BeerNutts on 17 October 2014 - 12:14 PM

Phil...is that you?

#5187021 Can I Make This Code Faster Without Over Complicating It ?

Posted by BeerNutts on 14 October 2014 - 03:01 PM

Don't create a new socket every time you do an out, rather create the socket and connect to the server once (in the constructor perhaps?), then issue all the commands after that without having to close and re-open the connection each time.  Close the socket when the client is done.


Similar with the server, have it not only listen for new connections, but also listen for data from existing open connections.


That alone should improve the efficiency.

#5185411 Board game into a video game

Posted by BeerNutts on 06 October 2014 - 05:51 PM

check out pygame.  It should have everything you're looking for: graphics, audio, input, etc. for python.

#5185374 Board game into a video game

Posted by BeerNutts on 06 October 2014 - 02:36 PM

What language are you programming this in?  There are tons of API's available for all the different languages, but you'll have to give some more info if you want a specific answer.

#5183884 RTS - targeting, moving close to target

Posted by BeerNutts on 29 September 2014 - 02:58 PM

What I've done is, if you select an enemy unit to attack, the player's unit marks that enemy, and simply moves towards the tile the enemy is on.  Part of the logic in the player's unit should be CanAttack(), meaning, is it close enough to attack.  So, while you're target tile is the one the enemy is standing on, your unit will stop once it's in attack range (a few tiles for ranged units, adjacent tile for melee unit).


If your enemy target moves, yes, you have to recalculate, but you should always use the CanAttack() to over-ride whether your unit has reached its intended tile or not to stop moving and start attacking.

#5183862 Interactive Tech Demos Turned Games

Posted by BeerNutts on 29 September 2014 - 01:48 PM

I'd say that's fairly common with programmers;  many of us enjoy making it work, rather than making a full game.


Making an engine, a framework, or an editor can be a lot of fun for us;  that feeling of accomplishment is constantly being felt.  Once we get to the point where all our integral stuff is working, that's when we need to make the content for a game, and these thoughts start going though our head:


Oh damn...I gotta draw levels, make up a ton of enemies, get images for the enemies, work on animation timings, find sound effects, make a stupid menu...UGH!


If you want to go beyond that stage, it's really a matter of persistence and dedication; how bad do you want it?  I've honestly rarely gone past that stage, and if I did, it was fairly short (ie, only a few levels, and only a few enemies).  

#5183393 Detecting tile collisions in a 2D platformer

Posted by BeerNutts on 27 September 2014 - 09:13 PM

You're tile map should be stored in such a way it's easy to get what tiles are located at which coordinates, like a Vector of Vectors (such that you can check [TileX][TileY], or make a call to your Map class to retrive the tiles within your world X, Y.


You would then only compare the tiles that live within your characters bounding box coordinates (X, Y - X + Char.Width, Y + Char.Height).  No need to check every tile that exists in your map.

#5181590 Code review of a pong clone created using SDL

Posted by BeerNutts on 19 September 2014 - 12:29 PM

You don't need a "RightPaddle" and "LeftPaddle" class.  Make a "Paddle" class, and pass in the parameters to the constructor that defines where it lives, and what keys move it.


Also, you shouldn't blindly have every surface defined in "globals.h" and have every class have access to them.  Define those surfaces in the classes that use them, or in the main file where they're used.  Then, you can pass in what information each class needs.


The huge if else if block in main.ccp is not needed.  Simply do something like this:


char score[4];
// get player 1 score
sprintf(score, "%d", ball.Player1Score);
score1 = TTF_RenderText_Solid(font, score, textColor);
// get player 2 score
sprintf(score, "%d", ball.Player2Score);
score2 = TTF_RenderText_Solid(font, score, textColor);


And, why are score1 and score2 globals?  Shouldn't they should be defined in main() since that's the only place they are used?


I didn't look at the rest, just a few things I noticed.


Good luck and have fun.

#5180785 Simple 2D lighting effects

Posted by BeerNutts on 16 September 2014 - 12:51 PM

Net-Gnome had a nice post in his journal about his lighting system using shadow casting.  I'd advise you to check it out.


He open sourced his code a while back too, so you can check out how he does it as well.

#5175894 Free game engine suggestions for a single-player top-down 2D RPG?

Posted by BeerNutts on 24 August 2014 - 07:03 PM

Just FYI, 2D RPG isn't the easiest thing to make as a 1st game, you'll have to make tons of quests, tons of enemies, tons of places on the map, and also learn to program it all.  You might want to start on something easier.  Regardless, here are my suggestions.


Well, for C++, SFML can handle all the graphics, input, sound, windowing, etc.

For your maps, I'd suggest looking at Tiled, and finding a good C++ Tiled parser (I believe there's one specific for SFML).

Then you'll probably want a UI, SFML has support for some linked here, unless you want to roll your own.

#5175080 Upgrading a function that loads config files.

Posted by BeerNutts on 20 August 2014 - 12:32 PM

You could also use XML. It will make the code more organized and TinyXML (http://www.grinninglizard.com/tinyxml2/) is awesome for file loading in this style. Using it in my Engine and it has worked really well.


FWIW, I used to use XML before I found out about JSON, but JSON is so easy and non-verbose, while xml can be a pain in the butt.


For example:

{ "Hero" :
  {"Health": 100, "Strength": 10, "Mana": 100, "Image": "HeroImage.png", "Inventory": ["Map", "Compass", "Sword"]}

In json defines a hero and his inventory.  To do the same in XML:


IMO, I found json to be much easier to work with, and the C++ json API's were easy to use too.

#5174995 Upgrading a function that loads config files.

Posted by BeerNutts on 20 August 2014 - 07:35 AM

My suggestion would be to look at storing your config files using a standard type, like json.  You could then use the jsoncpp lib (or jansson, or any other C/C++ compatible json API) to load the config file, and simply get the values using jsoncpp API's.  Take a look at it, I think you'll like it better than creating your own config file.

#5174994 Strange output when writing to a file object and printing it out

Posted by BeerNutts on 20 August 2014 - 07:25 AM

As was suggested, using the + options on files is sticky.  Instead, open a file for writing, write to it, close it, and then open it for reading:

file = open(fileName, "w")
file.write("Some string")
file = open(fileName, "r")
print file.read()


Or, a better way IMO:

# open the file stored in fileName, write some string to it, and it automatically closes
open(fileName, "w").write("Some String")
# open the file stored in fileName, read some data from it, print it and it automatically closes
print open(fileName, "r").read()