Advertisement

Game engine in C and open source, The Box, structural programming

Started by December 22, 2019 10:49 AM
129 comments, last by alex4 4 years, 8 months ago

Yeah that's true. Just wanted to know I'm not alone, although I saw the earlier posts of the other members.

Sorry for my spam regarding this.

If others already say the project is not going any here and you keep spamming saying the same at least post something new.

Even if the project goes no here you can still be reported for spamming other people topics.

I should report further spamming posts. The project is posted for people who want to follow not people who don't like it.


Advertisement

Updates

I started the engine because PHP allow for procedural engine. They also have a library for C. It also works for web. When i see the code was very happy because it allow the same style can be fit in to the engine.

added a new folder: “graphics structures” to be easy to develop and see where things are. Graphics have a lot of files it will be very hard to have all those files in "application structure". So i kind moved it to it's own thing.

LibGD, is structure the same way as BOX, it have tests, have very nice structure for graphics. Very small 2 megas.

BMP procedural

already putted the BMP to work in procedural is very fast, like a few milli secs for create a BMP

A second file output color information in procedural, now is a matter for making it to work in the interface.

Since library's like LibGD allow procedural style maybe will have something working before have procedural code for all things.

Library like SDL don't allow that much of procedural they have a more nested style which is a bit more hard to work or implement, refactor code, etc…

brokkolisalat said:
Sorry for my spam regarding this.

It was no spam. It has to be said.

Also this is a forum thread, open for anyone to discuss. Some people don't realize this, and they ignore my proposed solution to use a blog post instead, where spammers, drug addicts, people with dark skin color, and programming idiots comments would keep nicely seperated from… ‘work going on’.

So you only spammed yourself. And you will soon regret it, because there is no way yet to unsubscribe from getting annoying notification each time some unlucky person replies to this thread.

But still… welcome to the forum. All other threads are fine, as long as somebody does not start to spam them with offtopic suggestions about how his ‘engine’ would not solve the problem in discussion. ; )

@jdc There is also other library called allegro.

https://liballeg.org/

And about postprocessing images you can try devil library.

https://github.com/DentonW/DevIL

But can someone please tell me I'm not the only one seeing this?

No at all. It is, however, highly entertaining and (mostly) harmless.

Stephen M. Webb
Professional Free Software Developer

Advertisement

@JERUKA9

nice, going to put main graphics libraries in to graphics_structures folders. Now which theme have a folder instead of misc folders and files as most project have. Like src folder, then you have to search high amount of things.

In here we see the theme folder structure:

graphics_structures

game_structures

application_structures

now added “store_structures”, to deal width database, file, or any other kind of storage of information.

People can access best options, while in development of raw code. Also next version 0.0.4 will come width several free books.

Not only libraries, but also raw code, and the tutorial tool, which i'm working to access to tutorials links.

The goal is to have every thing working so when people grab the software will have all this stuff working. The concept is a bit opposite to other things , like SDL or OGRE, you open the project and now? read all this manuals, then read more manuals. Just code width no templates.

In here, most things come prepared, people will not need to search things.

Version 0.0.4 variable programming language & standard variables & text RPG & Storage

How the variable programming language is evolving.

Now we can program a weapon, or a spell width just variables. We can see a couple of things just width variables highly readable. In the example bellow.

Put every thing in one file, like application_structure.h to be more easy to read. If you want to program something to the engine. You can do it width, any kind of style like objects, functions, stack libraries, or another style i use just mathematics. That is a bit more read, unless you are a bit autist/deslexic like i'm am.

standard variables - We can't do this width out standard variables on the point that we have standard variables, we are no longer dependent on paid engines. A open source engine can evolve as equably as a paid engine.

Lets say : you program a function for your project which is not open source, then decide to share. It is working on my project because you use same variables.

It does not need to have the same style, you could use objects, or engine code, but if you use same variables, like a layer, to this variables it will be working. This have the benefit that can work with any kind of engine or code style.

Text RPG - adding a simple text rpg to test things will be more easy to develop and see global variables affecting things.

Examples: we can program a spell width the variable programming language.


actions = {}

action_name = fireball;
action_effect = damage;
action_type = damage;
action_damage[0] = 10 * character_level;
action_damage_type = fire damage;
action_target = ground;
action_type = decrease;  
action_consume_type = mana;
action_consume = 10 * character_level;


build_action();

action_name = weapon;
action_type = damage;
action_damage[0] = 2;
action_damage[1] = 10;
action_damage_type = piercing;
action_target = enemy;
action_consume = 5 * character_level;
action_consume_type = stamina;

attack_action();

action_name = jump;
action_type = "character action";
action_consume = 5;
action_consume_type = stamina;

character_action();

Text RPG, how variables are very easy to read. They come , from rpg, out side file still width high readability. The 2 name variables, help to understand code, in another context. Im this case they are in game_structure, maybe width some functions. But you can understand that you are calling a character_name. Because a variable “name”, in another context is no longer readable.



#include "../game_structures/game_structure.h"

int action;
int character_creation;
int empty = 0;
char c;
 
main(){
 
printf("1. play, 2. load"  );

 
if(character_creation == 1)
{
   
 printf("Name : ");
 character_name = getchar();
 printf("Race : ");
 race_name = getchar();
 printf("Gender : ");
 character_gender = getchar();
 printf("Age :  ");
 character_age = getchar();
 printf("Language : ");
 character_language = getchar();
 printf("Skills: 1. swords, 2.  ");
 character_ … = getchar();


If we use standard variables, we know that a character will always be store in the same way is just a matter to know which variables are used. The store to the DB or the index files that i created a mini database. Works width 2 file, one width ids, another width a database index structure storage, very simple.

Our current code for character. If you use the standard variables for the character, the db knows this structure and can save it to the database “selected” “width out the need to code all this stuff again”:

/*
	Standard Variables for Games.
*/

char character;
int character_id;
char character_name[2];
int character_age;
char character_gender;  
char character_title;
char character_image;
int character_3d_model;
int character_inventory;
int character_items[100]; //link
int character_spells[100]; //link
int character_abilitys[100]; //link
int character_status;
char character_race;
char character_type; // Npc, player
int character_inventory_size;
char character_background; // History
char character_family; // History
char character_language;
char character_language_list = {"common", "orcish"}; 

If your friend code, is database, width this new cool db engine. If we adopted the standard variables you can get is code, to work in your game, project. Even if is used in some kind of other engine.

Debate of Version 0.0.4

*Shaw some activity in facebook page, maybe is better to say is the current debate on 0.0.4 and not the lunch of 0.0.4.

Refactoring string.h library from C base to this. Lets lather test to see how much fast it is. If is not enough i will convert from stack_labrary to functions.


(“stack_labraries/string.c”)

if(string_concatenate == 1)
{
string_size = strlen(string_old);

string_new[string_size] =  

	while (string_size != 0)

	{

 	string_size--;

 	string_new[string_size] = string_old[string_size];  

	}

}

Updating the names, of this functions"strcmp". Which some new one, is hard to understand this old code style.

string_concatenate = 1;
string = “some test”
string_add = “in game dev”;

#include “stack_labraries/string.c”

new_string = “some test in game dev”;

it uses the same style variables programming language .

*maybe in the future this will add more automation to this functions, is also good to have things in costume libraries. It will help to update lather if needed.

Version 0.0.4 Lunch

I have no need to lunch another non working version at this stage, but people are showing so much interest that i will keep doing small updates.

Global variables. Finally found the write explanation for the header files. They only serve to have true global variables. Variables outside main are global but their scoop is limited. That's why you need header files.

This will change a bit the configuration of project, now we have a folder, called "header files" to define. Declaration is close to the same, but not the same is in the .c files.

They explain this very well in this article, one thing is declaration another is definition. In high level we only declare. In first version the explanation i found in tutorials was a bit confusion. In 0.0.1 version i have there in the comments definition and declaration in the same file. Which my not be wrong, but is not the purpose of header files.

https://stackoverflow.com/questions/1433204/how-do-i-use-extern-to-share-variables-between-source-files

Also “used external projects”, and “documentation” available in this version. Is a bit large.

But in this structure, it will be a bit more easy to work, since header files, do not need their own, specific, since they are only for true global's. People writing a header file, for which .c file don't know what the purpose, we read in the tutorial is only for true global's. One header file is probably enough.

300 mega, of documentations, and projects to see code examples and get familiar width code design, game design, functions, c programming, design languages, etc. See projects code working, it will be easy to convert code,

Don't know if i will give the trouble but : we can have a secondary header file, for this projects, to put their true globals there, it will separate the code much better and add readability.

Files are in google drive.

https://drive.google.com/open?id=1LqXNvuu5p5t7cQ4yH-7YEqugL7glslMk


*

This topic is closed to new replies.

Advertisement