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

Version 0.0.3

Another non working version.

This version is dedicate to finish planning.

Finished most of the planning. Now have a folder width interface images have interface planning for all tools. Separated the information in to different files, to be easy to access things. Likes: credits, debate, objectives, planning, etc…

The box files, evolve a bit, added new things, they are more in a planning state, but are evolving.

Added many debug tools, they now have a proper name like “test_something” in the editor may be a bit confusing to have 2 files width the same name.

The stack folder which I think as not in previous version, an now is in this version. Was debated in the forums.

The intro pdf, now explains a bit better the concept, etc… How things work in small “MVC” also work in a large “MVC” or stucture.

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

“nice coding for all”

Add the Configuration.h object

Many files, or libraries, have configuration inside, their code. We can put all configurations in one file.

We can change options from this file manually or use the software to do this automatically. Changing a project, can be done by the software accessing this file, and make changes and compile.

We could go a bit more complex, and put this in the file_map.h, so if we add something, it knows how to tweak.

A a module of the engine will be composed of 2 parts : the library + config information which is also a module to add to the configure file. Then is just a matter to know the rules for the map, and any one can create a module for the engine.

A bit of code from the two files graphics, from previous post:

The code is a bit messy but the usable version is standardized in to something more readable. Like several options for module in graphics, that are mapped in file map. Can be added to the software, for example: no 3D, no debug, JPG yes.

A simple module that will not affect to much code rules that already exist, and can help automate projects.

To avoid errors we could put this in a interface, width just the rules, when some one is tweaking will not make any mistakes, could happen for non programmers. :

  • jpg
  • png
  • 3d
  • debug
//------------------------------------------------------------------
// Internal config
//------------------------------------------------------------------

#if !defined( EZD_NO_FILES )
# include <stdio.h>
#endif

// malloc, calloc, free
#if !defined( EZD_NO_ALLOCATION )
# if !defined( EZD_NO_STDLIB )
#  include <stdlib.h>
# else
 // No debug functions without stdlib
#  undef EZD_DEBUG
# endif
# if !defined( EZD_malloc )
#  define EZD_malloc malloc
# endif
# if !defined( EZD_calloc )
#  define EZD_calloc calloc
# endif
# if !defined( EZD_free )
#  define EZD_free free
# endif
#else
// Must use static fonts if no allocation routines
# define EZD_STATIC_FONTS
// Assume our debug functions won't work either
# undef EZD_DEBUG
#endif

// sin(), cos()
#if !defined( EZD_NO_MATH )
# include <math.h>
#endif 


Advertisement

Module Manager

Continuation from previous post.

"As people ask don't people need to learn this engine?"

Well this module will help the learning curve. Instead of people learn how to do modules. Create a interface, to handle module creation, and management of rules.

In the structure not that much alter thing since it have very low dependency's. “If you work on a file that respect global variables it will work in any situation” People asking for Git Hub well the paradigm is a bit different in this style of code. Other files will work regardless any thing. They inherit much of their stuff, another aspect you don't need to code that much.

Is still a bit raw in therms of planning i don't know that much of C and how this could be done. But it may look something like this.

Manage all dependency's of files, how this could affect the structure. Squeeze more redundancy out of code.

this could do: add settings one by one to the module, and in “configuration” link, you have all the settings for the libraries used.

This could allow to work with settings in different files, but it could break the structure. Since to debug and read code that will be much harder. And even to configure this tool, it will have to read all those files to load them to settings. Still not a big problem, but in therms of managing or maintain code. You may get problems lather.

All this is not because i like to make posts, is because maintain code is very hard : Create a couple of functions, start nesting things, tomorrow you become drunk can't remember code. And now what will we do to work? We can't, it consume to much time to re-learn code over and over. That's the main reason readability of code is important. If you can't read code directly. You can't program in any situation.

jdc said:

This is not your post, to come here, and do your thing, come here as a guest. You are in other people house. respect the rules, ****!

Well, technically you're renting an apartment in someone else's apartment block. And if you upset the other tenants or the body corporate, you can be evicted. But you do your thing man.

For local multiplayer retro themed games, visit Domarius Games.

Sure or we could contact moderator to see what they care more, random people opinions or people that are working for the community. Opinions in programming are many. Work only a few present something.

But ya “all do there thing”. Some do no thing at all.

If you have problems contact moderator to moderate topic.

Adding the project to Git Hub

For me is awful. No empty files allow. What if programs will fill this empty files? A bunch of weirdness that git hub : Move files by commands, edit files only inside files. Delete file only in edit mode. Is like working in a 80's computer.

But people are asking to work in it sure go ahead. I will not use it but the project is in there at least what is supported.

Linux doe not work width google drive, i tried in a updated system. And maybe the admin part is not supported. Maybe will add also to Surce Forge.

Here is the link : https://github.com/saintsoftware/the-box

also in discord chatting debating project in “the coding den” C channel. Search for it in discord if you want to join.

Think “game dev” also have a discord server, but since is more generic, using a specific channel for C.

Advertisement

For people that complain that i don't answer to people enough.

Even 2 loops are faster then 1 loop. This is how nested things consume on processing.

I Shaw this in PHP. Nested stuff like open files, OOP all where slower then procedural.

const int n = 100000;

for (int j = 0; j < n; j++) {

a1[j] += b1[j];

c1[j] += d1[j];

}
------
for (int j = 0; j < n; j++) {

a1[j] += b1[j];

}

for (int j = 0; j < n; j++) {

c1[j] += d1[j];

}

https://stackoverflow.com/questions/8547778/why-are-elementwise-additions-much-faster-in-separate-loops-than-in-a-combined-l?rq=1

Okay, I just read this whole thread and just signed up to this forum for this because it bothers me so much.

How does noone address that this guy is literally insane?

His reactions to comments and help are narcissistic and his views on programming topics completely devoid of reality.

I know I sound like a jerk and I certainly wouldn't judge someone for being unexperienced or uninformed, but his attitude is on another level.

It's really nice that people try to be supportive and helpful, seems like a really friendly community here (sorry for not being a part of it with this kind of post).

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

Edit: Just want to clarify it's about the personality, not the project itself. The intention is atleast a good one and it's a good project to learn about engines.

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

I haven't noticed. My eyes glaze over when I have to invest time into figuring out what someone is talking about.

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

@brokkolisalat Some members have already told him this is going nowhere and are now just waiting for the ship to strand. There's just no point in discussing with someone who doesn't want to discuss.

This topic is closed to new replies.

Advertisement