RPG - ActionScript or C++ & Allegro

I currently have a good bit of knowledge when it comes to C++, but was wandering whether it would be better to learn AS3 and make the game i am planning in flash, it is only going to be a small RPG game, where grinding mobs for XP is key, few quests blah blah blah... But as it is such a small project what do you think would be best?

AS3 and upload it to flash game websites, or C++ and distribute it via box.com or other file hosting websites with forum posts, not too bothered about making money, i am only a student and wish to do this to further increase my knowledge within programming.

quick summary
Planning on making small RPG game
only gonna be 2d game
example of style - enchanted cave(flash game) // dungeons of dreadmoar (indie game)
either c++ or flash action script 3
know c++ to make with graphics library, allegro (any other suggestions)
learn flash and make with that
SFML is good for 2D graphics in C++...

Pros of C++
- Lightning fast
- No need to learn a new language
- Cheap to develop for (no need to buy flash)

Pros of Flash/ActionScript
- In browser gaming
- In browser gaming
- In browser gaming
@strongdrink

Thank you for your reply.

I already own every CS5.5 software, so not owning flash isn't a problem.
The 'In browser flash game' and the ease of distributing it for others to have fun is the most appealing thing with flash, other than dropbox, box.com and file hosting sites i know no other way of distributing C++ games.
I have a lot of the basics to flash and find it relatively easy, but it will just be a lot slower for me to develop anything as i don't know as much as i do with C++.

I will take a look at SFML now too, I am using Code::Blocks as a compiler, just to let you and anyone else reading know.

Again, thanks for the reply.

Another thing I had a quick look at, was UNITY... I have the latest 3DS max and the ability to make simple models, most advanced thing i have made is a fruit bowl with bananas and oranges textured, but hey... there are tutorials for that too, with the unity web player these could be put in browsers too.
Well, I don't really know any ActionScript, but I'd suggest using it.

Besides what you've already said, I bet you'd get less segfaults with it. If your goal is to quickly make something somewhat simple, I'm sure Flash is the more appropriate tool. And it's always good to learn a new language.

Also, you're probably not going to make something great the first time your try anyway, so you might as well take your time. If you try ActionScript and then decide that C++ is better, the time will not have been wasted. The problems you'd face in both languages will be basically the same. Whatever intelligent design you come up with in AS, will work in C++ too.

And you really don't need that mystical performance of C++..
Last edited on
Thanks for that input hamsterman, the one thing i am certain on is a tile based system for the game. I have two friends who know a lot about action script 2/3 and one of them has helped me make one. This is another factor that swayed me towards AS3. What you said is right about the time too. I have a fair bit of spare time i waste just sitting and listening to music, i need something to focus on. Well ill keep coming back here, but for now ill carry on with the flash tutorials i started.

If anyone else has anything else to say it is welcome, still not 100% made up, but swayed largely towards flash.
I know both languages and I think it really depends on what you want to do. If you're going with actionscript though I suggest using AS3 it's faster compared to AS2. Actionscript 3 is rather similar to Java, so you don't need to worry too much about garbage collection unless you really want to optimize the game and such. I think it's like a cross between Java and javascript.

actionscript is quite good for browser games, also it might be easier for your friends to use as well cause you can just put all your game assets in the library, although it makes the swf file larger. I think another advantage would be for mapping, since in the flv file you can set up grids. So it would also be easier for your friends to design maps and stuff without using third-party tile mapping software like mappy.

There's a big difference though when it comes to game logic in flash though. Well and that is actionscript doesn't have a main function. Also you won't have a simple game loop like in C++.

in C++ your game loop may look something like

1
2
3
4
5
6
7
8
9
10
11
bool gameOver = false;

// initialize game

while(!gameOver)
{
    // get user input
    // update
    // render
    // sleep
}


which is rather clear and easy to understand. However you can't do that in actionscript. In actionscript you need to use the ENTER_FRAME event, or a Timer event. So lets say you have some symbol in your library called HeroSprite. You'll need to attach an enter frame event listener to it like.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var hero:HeroSprite = new HeroSprite();

// center our hero sprite on the stage
hero.x = stage.stageWidth/2;
hero.y = stage.stageHeight/2;

// add an event listener to our hero
hero.addEventListener(Event.ENTER_FRAME, heroAnimation);

// add the hero to the stage
addChild(hero);

// define the heroAnimation function
function heroAnimation(event:Event):void
{
    // do your hero animation here
}


Well that's for the enter frame event. By the way, the enter frame event triggers every frame. So if you have 30 fps, 30 enter frame events will be triggered in one second. It's not good to rely on the enter frame event though cause if someone is viewing your game in like 3 frames per second the animation would be very slow. So basically you end up using Timers, however timers trigger depending on how many milliseconds you set it to trigger, So there may be problems with consistency, like if someone is viewing your game in 3 fps, then the animation would be very jerky and abrupt with huge increments in the movement. The solution to that really is like getting the starting point, then the end point of the movement and basically compute the amount of increment, depending on your time and fps.

Also you'll have to apply this to each animated sprite on your game. So the game loop isn't as simple and well structured as in C++ if you ask me. And when you're trying to make the transition from C++ to actionscript it would be difficult to grasp at first because you'll need to understand these differences in the game loop structure. So I think that's one thing to keep in mind as well.
Last edited on
Topic archived. No new replies allowed.