Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 05 Jul 2002
Offline Last Active Yesterday, 06:56 AM

#5248520 Is ray tracing hard or is it just me?

Posted by Alpheus on 24 August 2015 - 07:36 AM

I'm not a graphics programmer, but in listening to people who do this often, raytracing is like pimpin'. It ain't easy. Also, based on what they say, if you know the maths, it should be most of the battle.


I'm shocked though that google hasn't led to you a solution though.




This is the first link I found. Seems to have everything you want.


Google search.

#5248316 Our Oculus Rift concept transformed to 2D (aiming for Steam Greenlight 2016)

Posted by Alpheus on 22 August 2015 - 08:17 PM


Seriously? A video of all text? You could have left that in the description section or just provided a link to a webpage. At the very least, you could have put in the text in Star Wars font to make it worth looking at.

#5248076 RPG, Engines and Frustration

Posted by Alpheus on 21 August 2015 - 11:23 AM

If you want something to do, go get a small sprite on the screen. If you can't get a sprite on the screen, you're not ready to proceed and there's other things you need to learn before you continue. If you do manage to get a sprite displayed, then make it so you can change its position using the keyboard. Then animate it. Of course you'll probably want more than one sprite on the screen so take a shot at that. Then take a stab at collision detection. And make sure to test it out when the sprites are moving really fast. (I've wasted so much time trying to get collision detection right). Hopefully getting these things going will give you a good idea of whatever API, engine, or libraries you've chosen have to offer.

Hopefully you at least end up with some basic bits of functionality that might be fun to combine in different ways to make smaller simple games. If you don't want to bother trying to make smaller games at least each of these things will build onto your ultimate dream game. But there's still a lot more things to learn and odds are that whatever you've done to get the above functionality going isn't going to be considered best practice or even be all that expandable into whatever area that you might have the notion of experimenting in next.


Allow me to expand and give a slight alternative to the above. Which by the way is good advice.




You want to make: 'Zelda: A Link to the Past'. Great. Now let's look at some options. You can use Unity or Unreal. But those are really 3D game engines. And frankly you're a beginner. So let's go down a notch and look at 2D libraries. Two popular and battle-tested libraries are SDL 2.0 and SFML 2.0. You're a programmer. And you want to make games. These two are up your alley. You may want to ask, "which is better?". The answer is: neither. They take slightly different approaches to do the same thing. But if you really want to make a decision of which one to use, do the following in both SDL 2.0 and SFML 2.0:

  1. Create a full screen
  2. Created a windowed screen
  3. Place a sprite on the screen (it can be a candle, box, brick, fireball, mario, stick-figure... basically whatever)
  4. Move that sprite with either the keyboard OR the gamepad
  5. (Optional) For a challenge, support both keyboard and gamepad
  6. (Optional) For another challenge, see if you can alternate between windowed and full screen

Now, determine which library was "easier" for you to get set up and going. Once you've made that choice, go to this article. Yes, I'm plugging my article. But it does give the reasons and games you should make to be able to have the skills to make a RPG like Zelda.


Now once you've done all that. You should have a good idea of how to approach making a game in any platform whether its 2D, 3D, VR, or some future tech.

#5248049 RPG, Engines and Frustration

Posted by Alpheus on 21 August 2015 - 08:06 AM

The most common mistake beginners make is for some reason assuming that dream game they have been wanting to make absolutely must be one of their first projects. As if it has a deadline or something.

By definition, a “dream game” is more complex than Tetris. It’s your dream. You have put perhaps years of thought into it. It is obviously quite complex.

Therefore, by definition, if you have to ask how to make your dream game, you aren’t ready to make your dream game.

You are ready for a Tetris clone (with AI), or Pac Man, maybe half a stage of Super Mario World, or you can gear it towards your specific interests by making a very very small chunk of The Legend of Zelda: A Link to the Past (with absolutely no intentions of ever turning it into your dream game—that would be the worst possible thing you could do and the biggest injustice you could ever do to your dream).

Your dream isn’t going anywhere. If you got into programming just to code a single game, you can never have a career here. Not only as a service to your dream game, but also to your future in programming if you plan to have one, this is the time when you learn how to get where you need to be to eventually realize your dream.

Having a goal is a good thing. Being able to understand on your own all the steps needed to reach that goal is an even better thing. And finally being able to work on things you don’t necessarily want to do in order to work towards the greater good is absolutely necessary for any future in this industry.

L. Spiro


This should go in the 'For Beginners' FAQ. Stat.

#5246789 How can this code be refactored to be more proper OOP?

Posted by Alpheus on 15 August 2015 - 05:32 PM

How can the code below be refactored to remove the set and get methods? And more importantly should they be and why?

// Code taken from somewhere
#include "app.h"
#include "enemy.h"
Enemy::Enemy(App* app, const char* file,int screenWidth, int screenHeight, SDL_Renderer* renderer) {
        x = 0;
        y = 0;
        w = 0;
        h = 0;
        fireTicks = 0;
        fireRate = 400;
        velocity = 250;
        alive = false;
        enemyBulletTex = NULL;
        this->app = app;
        if((enemyTex = gfxManager::loadTexture(renderer,file)) == 0) {
                throw std::invalid_argument("err, could not load the enemy texture!");
    if((enemyBulletTex = gfxManager::loadTexture(renderer, "../gfx/enemyBullet_1.png")) == 0) {
        throw std::invalid_argument("err, could not load the enemyBullet texture!");
    SDL_QueryTexture(enemyTex, NULL, NULL, &w, &h);
    x = (screenWidth - w) /2;
    y = 150;
Enemy::~Enemy() {
void Enemy::think(float elapsedSeconds) {
    if(isAlive()) {
        // boundaries detection
        if(x < 0) {
            x -= x;
        if(x + w > app->getWidth()) {
            x -= (x + w - app->getWidth());
void Enemy::render(SDL_Renderer *renderer) {
void Enemy::shoot() {
    int currentTime = SDL_GetTicks();
    if(fireTicks + fireRate < currentTime) {
        for(int i = 0; i < app->getBulletPoolSize(); i++) {
            if(app->getBulletPool()[i]->getActive() == false) {
                app->getBulletPool()[i]->setX((x + w / 2)-app->getBulletPool()[i]->getW()/2);
                app->getBulletPool()[i]->setY(y + h / 2);
        fireTicks = currentTime;
void Enemy::setAlive(bool status) {
    alive = status;
bool Enemy::isAlive() {
    return alive;
int Enemy::getX() {
    return x;
int Enemy::getY() {
    return y;
int Enemy::getW() {
    return w;
int Enemy::getH() {
    return h;

#5246307 Is Javascript easy if you know basic C++

Posted by Alpheus on 13 August 2015 - 03:31 PM

Typescript is my favorite,


That would be the most reasonable transition. But if he's doing Android work, I really don't know what Javascript has to do with it. If he wants to make games for the web that can be accessed by his Android, then cool. But native apps? That tree he's next to has "Don't bark up here" sign on it.

#5246226 Is Javascript easy if you know basic C++

Posted by Alpheus on 13 August 2015 - 09:10 AM

Before we go down the rabbit hole, what exactly are you trying to do? Find more challenging projects, be a web developer, or be a mobile app developer?


Answering this question concisely will help us help you :)

#5246215 Is Javascript easy if you know basic C++

Posted by Alpheus on 13 August 2015 - 08:29 AM

Once you know a language (and 'know' is subjective) you can learn another similar language without too much trouble. However, javascript handles classes, inheritance, and few other things very differently than C++. Javascript is actually a "Prototypical" language. Non-trivial language features revolve around functions and prototypes. Also, references to parent or base classes (functions) are handled differently in Javascript than in C++.


In short, you can learn Javascript after learning C++. But learn Javascript and don't try to compare it to C++. If you do, you'll be causing yourself more trouble than needed.

#5244844 About to start my graphics course

Posted by Alpheus on 06 August 2015 - 09:49 AM

Graphics can be something as simple as putting animated characters and objects on a screen. Or it can be an approximation of what we see in real life. Or anything in-between.


Expect heavy use of and solid in knowledge in: geometry, linear algebra, and calculus. Expect to translate that math into code.


It's math and code.

#5242979 To use mana or not? (that is the question)

Posted by Alpheus on 27 July 2015 - 08:58 AM

When you encounter monsters, combat is turned-based and each character can perform one attack or special skill (based on class) per round. However, there is several ways to handle this:
1. All skills (including basic attacks) are "equally good" and you can choose anyone each combat round (used in darkest dungeon)
2. Like 1 but each skill has a cooldown of X turns. More powerful ones have longer cooldown. Cooldowns only refill during combat, not while exploring (so CDs will remain into next fight).
3. Skills cost mana/energy to use, so more powerful skills use more mana, forcing you to plan. It regens in town only (maybe with rare potions as well.
4. Use both CD and energy (like most MMORPGs, like wow)
5. No mana is used. Skills are limited use. So you can only use ice bolt 2 times and healing wave 1 time. Resets in town.
What are your thoughts on this? Each character already has HP and morale bars, so another bar (mana/energy) might be too much.

1. Aside from variety, I don't see the upside to this.
2. Cooldown should refill during exploration. IE. they should be reset at the start of every battle.
3. Standard and fair.
4. IMO, that's a bit punitive to the player. Is there an in-battle reward in using spells? Is there a way to overcome this as a team? EX: can a player speed up cooldowns of other players and/or replenish mana of other players?
5. I'd save that for the Legendary difficulty setting.

#5242665 Breaking out of a nested loop

Posted by Alpheus on 25 July 2015 - 01:52 PM

If you've got two for loops you're looking at O(n*n) execution times.


I'd be tempted to refactor the code and eliminate the for loops if possible but that's just me...


In all seriousness, I'd be interested to see that.

#5242176 Where to begin

Posted by Alpheus on 23 July 2015 - 08:38 AM

This might help:

#5241597 Know almost nothing about Game Development; Here to learn

Posted by Alpheus on 20 July 2015 - 02:53 PM

Go to Tom Sloper's forum (here on GameDev) and read up on the information there.

#5241219 Where to begin

Posted by Alpheus on 18 July 2015 - 10:17 AM

Take a quick read of this article: http://www.gamedev.net/page/resources/_/technical/game-programming/your-first-step-to-game-development-starts-here-r2976


Then google any of the games listed in the article to learn how to program them.

#5241189 Is there software that creates Game Design Documents?

Posted by Alpheus on 18 July 2015 - 04:41 AM

Well the OP of this thread seems to have made some GDD creation software. I thought it was interesting. So, again, I wondered if there was anything else like it. But it seems most people just use a collection of tools.