An Intro to The A-Engine and How to Find Your Way Around It

Go down

An Intro to The A-Engine and How to Find Your Way Around It Empty An Intro to The A-Engine and How to Find Your Way Around It

Post by A-MAN 24th February 2014, 6:05 pm



-Intro & What is the A-Engine all about
Long time ago, as a kid, video games, and computers in general, have always been a very important part in my life. One thing I have always questioned my self: How do they make games? I kept fantasizing about what game I would create if I can make one. Days passed, and I stumbled upon a beat 'em up game called LF2. One thing that interested me the most was it's ability to be completely modified into another complete game. Along side that, I adopted programming as a hobby I practiced in my free time. Time passed, programming got more fun than ever, thus I was motivated to start up my very own project to help people create their games easily without facing any limitations.

Now to answer my question "How do they make games?":Games are computer software just like the internet browser you're using right now to read this. The only thing that makes a particular software be called a game is the way it works. Computer software are generally created, or more precisely written, in a programming environment; an environment where you pack a set of commands and orders into an executable which can be run later by what we are most used to; that is double clicking the exe icon XD. Writing games is not really any thing other than that; but it is not as easy as it sounds.

Suppose you want to create a game where you can control an cockroach on a screen. To do that, you will first have to create your very first black window. And then you will command the computer to "Blit" or "Render" or show your cockroach image into this black window. In order for it to move, you will have to set up a loop where you handle all the inputs, have the cockroach move according to what arrow button the user will click. The term moving, is still a hard concept for computer to understand just like that. You will have to explain to the computer how to move the cockroach image. From the definition of velocity, we know that we need to change the position of the image X distance unit per a second (in our case, the distance unit it going to be the Pixels on the screen).

Now suppose "position_x" is where your cockroach is right now. You want to move your cockroach to the right 20 pixels when the Right Arrow of your keyboard is clicked. Here is a pseudo code of how you would do it:
Code:
if (right_button_is_held){    position_x=position_x+20}show_image_of_my_cockroach_at(position_x) //comment: this will show the new moved cockroach image on the screen
Here is the result after you click the button once:
An Intro to The A-Engine and How to Find Your Way Around It V3sIhp0
Tada! Another problem! We forgot to tell the computer to clear the first cockroach before we show another one!! It is still a long way to go for such a basic thing!! Now that's what Game Engines are for. In a game engine, the programmers have already wrapped up everything you would need into few simple commands with even a simple syntax!In an already designed engine, to have your cockroach move on the screen, you would write something as simple as:
Code:
move_on_x= 200
and you would have the result we're looking for! Things can even be waaay easier than that! Now this is what the A-Engine is all about!


Last edited by A-MAN on 24th April 2014, 7:29 pm; edited 5 times in total
A-MAN
A-MAN
Revolutionary Army
Revolutionary Army

A-MAN : Team A Leader
Posts : 2690
Reputation : 347
Bellies Bellies : 18841
Online
Offline


https://onepiecea-edition.forumotion.com

Back to top Go down

An Intro to The A-Engine and How to Find Your Way Around It Empty -The A-Engine

Post by A-MAN 11th April 2014, 9:22 pm

-The A-Engine
The A-Engine is beat 'em up game engine that I wrote in C++ using the strongest combination of the multi-platform OpenGL API and the SDL library. The beat 'em up game genre involves usually swarm of enemies attacking you at the same time. The genre also features the ability to move side ways in the Z-axis, usage of items and weapon on the ground and wide open battle fields to play on. Here is a demonstrating screen shot:
Spoiler:
The A-Engine is originally written to ease the process of coding a full fledged Beat 'Em Up. You will be writing your code in some special formatted files suffixed by ".a"\".A". You are, as well, given the ability to load up sprite grids with various formats; BMP, PNG (with 100% support for transparency), GIF (non-animated) and JPEG. Animated PNG support is also in my to-do list, so you can expect that in the near future. You can also find some interesting statements which helps you do some image editing and transformations during run time. Automatic shadow generation is supported as well; so you needn't bother shearing and doing the shadows for your characte(s)/object(s). It is all automatic!

Sounds are well supported with various formats; MP3, OGG, WAV. Various run time audio editing statements are available as well.

Videos are not supported just YET, but I am planning to allow using them for cut scenes or for games' intros.

To get started, you will have to understand what the A-Engine package contains. Inside the package folder, you will find an "A-Engine Demo.exe". This is your main game's exe which runs a demo game with a template character and a template stage.
An Intro to The A-Engine and How to Find Your Way Around It PE6gphF
Once everything is loaded:
-Your custom introduction screen, and the A-Engine's introduction screen shows.
-The main menu shows with all the modes and other stuff.
-Upon selecting any playable mode, you will be taken to the character selection screen. From there, the player will pick characters and a stage to play on.

Note that both the character's and the stage's data are stored in 2 ".a" files located in the "obj" folder; however, the content of both kinds of files differ. Characters, energy balls, effects or anything that can move will be referred to as an "Object". A stage or background will be referred to as "BG" or "Background" all together.

Although both Backgrounds and Objects use the same data type (".a"/".A" file format), they still differ in their structure. An Object ".a" file is made up of unites called "Frames". Each "frame" contains the data of a single sprite(1), and these frames work sequentially together to form a dynamic animation for your object; whether they form the walking animation of your character, or the moving animation of your energy ball. Other certain data elements you will set will decide if that object is a playable character, a moving energy ball or just a spark effect that function for nothing but visuals. A Background ".a" file, on the other hand, consists of "Layers". To be simple, a background such as this one:
An Intro to The A-Engine and How to Find Your Way Around It Parallax_scrolling_example_scene
Can be said to be made up of 3 different layers:
The sky layer (back): An Intro to The A-Engine and How to Find Your Way Around It Sky_back_layer
The vegetation layer (middle): An Intro to The A-Engine and How to Find Your Way Around It Vegetation_%28middle_layer%29
The ground layer (front): An Intro to The A-Engine and How to Find Your Way Around It Ground_%28front_layer%29
And that is exactly what you do when working with backgrounds. In addition, you are given the ability to add more dynamic background features such as wind that can actually push your characters, moving platforms, water ..etcetera.

Now after you pick your character and the stage you are going to play on from the selection screen, the exe will work load your characters from an extremely important .txt file, the "load.txt" file. This file contains the directories(2) of almost all the ".a" files you're going to use in the game. For now, you just need to understand that when you start a fight after choosing your characters and a BG from the selection screen, they're going to be loaded in the manner "load.txt" commands. It will be covered in detail later.




Now, if you understood everything above, then you are ready to proceed with more detailed and covering topics:
Spoiler:


Please report any spelling or grammar mistakes if found. Question are welcome.
A-MAN
A-MAN
Revolutionary Army
Revolutionary Army

A-MAN : Team A Leader
Posts : 2690
Reputation : 347
Bellies Bellies : 18841
Online
Offline


https://onepiecea-edition.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum