Page 1 of 3

The Box, development tool, "Structural programming"

PostPosted: 09 Dec 2017, 10:40
by jdc
The Box, Development tool.

I have worked and applied the concepts of structured code to a Procedural PHP engine for the web. I have the idea to develop a open source tool for the community in C.

The engine will be build in C, to have better performance.

It is on google drive : https://drive.google.com/drive/folders/ ... sp=sharing

discod

https://discordapp.com/invite/Mwgxgzf

How to build inherit files ?

movement.c // handles movement
score.c // handles score
team.c // handles team
team_rts.c // handles team for a rts game
team_fps.c // handles team for a fps game
team_rpg.c // handles team for a rpg game

The AI Language ?

@PHP open tag : <?php

@PHP echo string : echo "hello free game dev comunity";

@PHP close tag : ?>

This will make it very easy to output : string hello word -> miss something

AI Structure back trace ?

Handle file and variables dependency automaticaly for us. Back tracking what is being included and where.

variable red_team -> declared at main
called in : teams, game, network.

notices :

-> Possible error at game
-> slow performance at network.

Include pre build Library's packages ?

Art" a thing that will be possible will be to have game ready Art, In a ready to use packages. Instead of we all updated this stuff, search, and create or own library's we have a ready structured library that speed up this process.

3D characters (open source)
3D characters (Paid)
3D Tree's desert (open source)
3D Tree's tropical (open source)

Build in tools : Screen play & character creation & Name generator ?

We could also have more built-in tools, to speed the process of creation the game concept, like a proper name generator, a character stats and list generator that will be game ready.

A example: You insert your list of spells in the program, and once you are ready for production click in generate file and it generate the production programming file ready to be used in the game. This will minimize mistakes and debugging time.

The tool interface example ?


The tool will speed up the programming process and other's process's, by having a set of tools available.



open_engine.jpg


Payment ?

Patrons are very popular way to have costume made code. Better to donate for a open source tool then for a engine which even if you buy all lunches and subscriptions you will never have access to the code unless you pay a very high amount of money which is is almost enough to develop a new engine.

help in Development

Is always good to have people helping

code

index for arrays in C?

We create 2 arrays one is the index and the other is the arrays, so lather it is coded in to the tool so it handle this for us so that it prevent mistakes.

For example :

{l Code}: {l Select All Code}
char spells_index [1][4] = {

   {"Name", "power", "mana_cost", "time_casting"}   
 
};

char spells [10][4] = {

   {"agility", "30", "10", "300"} ,   
   {"..", "..", "..", "..."} ,   
   {"..", "..", "..", "..."}
};


You the see the connection, 0 position is the name index. while 4 or last position is the time casting.

Re: The Box, development tool, "Structural programming"

PostPosted: 09 Dec 2017, 10:43
by jdc
outdated post ...

Re: The Box, development tool, "Structural programming"

PostPosted: 09 Dec 2017, 10:56
by jdc
outdated post...

Re: The Box, development tool, "Structural programming"

PostPosted: 10 Dec 2017, 02:43
by Lyberta
I have a very hard time trying to understand what you are trying to say. But here's a few thoughts.

C is a very old language that is very much stuck in the 1970s. This is good for very resource constrained systems but if you're cross-compiling, you might as well use C++ or (not sure if today) Rust. Raw pointers suck. A lot. There a reason Rust has put them in unsafe and Core C++ Guidelines prohibit pointers as a tool for resource management.

Games are usually built on top of the game engines and those provide abstractions. Games may hardcode a bit of stuff, but most FOSS games allow users to modify a lot without recompiling the code. So no mature game will hardcode arrays with stuff. Maybe only default values.

PHP is a fractal of bad design.

To me, AI is a system that can learn. If it doesn't learn, it's a script, not AI. Most machine learning algorithms now use neural networks and it's hard to reason about inner workings of a trained neural network. I have seen AI algorithms that use Turing-complete programming language to solve given problems but I don't think the programs that get generated by AI will be easily understandable by humans.

Overall, I think you need a bit of experience to reason about things you want to do. Just PHP and C will leave a bad taste after you move to something more modern. But learning a basics of C is a good knowledge, just don't try to write huge systems in it.

Re: The Box, development tool, "Structural programming"

PostPosted: 10 Dec 2017, 11:37
by jdc
Thanks a lot for the feedback constructive criticism is always welcome.

I disagree lightly, Linux is build on C so is a good language after all. Agree that C could be a bit updated in some aspects. PHP push languages a lot forwards bringing new functionality and ways of doing things in new ways. In terms of innovation i think is a great language.

Most of the stuff that is in that article, i think is more a person that is not very creative, or don't like to solve problems. Of course is going to have problems with a loose language like PHP. If you are expecting the programming language just to allow things to be done in one way or very strict, but that cut off all your creativity. Can become extremely boring to code like that.

Other stuff they updated that in a regular basis last update was last month on 30 November, i have my doubts that the arrays are inconsistent, Facebook is build on PHP ...

But people can choose what they like...

Re: The Box, development tool, "Structural programming"

PostPosted: 11 Dec 2017, 05:40
by Lyberta
jdc {l Wrote}:I disagree lightly, Linux is build on C so is a good language after all.


That is a cargo cult mentality. Linux is built on C because C was the best language to write operating system kernel in late 1980s. Nowadays, it is possible to use most of C++ inside a kernel but Torvalds has a personal phobia of C++.

jdc {l Wrote}:PHP push languages a lot forwards bringing new functionality and ways of doing things in new ways. In terms of innovation i think is a great language.


Did you read the article? PHP never invented anything, it copied some stuff from other languages and most of the time failed to implement those features properly.

jdc {l Wrote}:Most of the stuff that is in that article, i think is more a person that is not very creative, or don't like to solve problems. Of course is going to have problems with a loose language like PHP. If you are expecting the programming language just to allow things to be done in one way or very strict, but that cut off all your creativity. Can become extremely boring to code like that.


When you are the beginner, you may have some joy of discovery and feeling of being creative. When you are experienced, you just want to get the job done and make code understandable to other people. I don't want to fight against the language when I code. Writing code is very boring, what motivates you is seeing what your code has done.

Re: The Box, development tool, "Structural programming"

PostPosted: 11 Dec 2017, 15:54
by jdc
How do you know what motivate me?

Check Torvalds open source page : https://github.com/trending/c

Torvalds hates C++ ? Naaa is a proven fact debated on the forums that C++ or objects for that matter are slower. C with pointers have a very stable performance. Is the lower language available, which is more or less easy to write, some parts are written in Assembly.

Try for your self a 3D engine build in C# sharp since you like so much, its is incredible slow in a computer with 10 or more years like my own.

C++ can achieve more performance then C# Sharp, is true but still is not that much good to develop a operating system since, it does not achieve the same performance was pointers.

Windows languages: C, C++, C#. Some parts in assembler. It's build the same way was Linux.

Maybe width the new computers that does not matter, but this is how thing are made. You should read more about low level programming language. languages that are close to machine code have more performance. They are hard to programme and have more performance.

Objects are a entanglement of data, so they are bit far way for the zero and ones that the computer understand. So that mean after compiled more CPU activity to be done.

Assembly is closer to computer language, but extremely hard to program. You can see a code example for assembly:

mov edx,4 ; message length
mov ecx,msg ; message to write
mov ebx,1 ; file descriptor (stdout)
mov eax,4 ; system call number (sys_write)
int 0x80 ; call kernel

It's performance much more higher then C. Can search games build in Assembly. Tycoon think was build in assembly it have a extremely high performance for the time. It loaded a lot of stuff, think no other game does that at that time .

Re: The Box, development tool, "Structural programming"

PostPosted: 11 Dec 2017, 17:25
by Julius
Let's not make this into a "my favourite programming language it better than yours" discussion, please.

Re: The Box, development tool, "Structural programming"

PostPosted: 12 Dec 2017, 01:37
by dulsi
Programming language isn't a big deal. You can write interesting games in any language. However, I have no idea what you are making. It's some sort of development tool. I don't know if it is C or PHP or both.

Re: The Box, development tool, "Structural programming"

PostPosted: 12 Dec 2017, 11:56
by jdc
Julius : don't mind answering to people if that what motivates them to work. Knowing all the details.

Dulsi : it is stated clear that is done in C in Dropbox only contains files in C. But often project contains several languages. For example a database is made in SQL which have nothing to do with PHP or C. Engines like unreal have the core done in C++ and have biding's for Lua, or other high level scripting language.

Re: The Box, development tool, "Structural programming"

PostPosted: 12 Dec 2017, 12:06
by jdc
outdated post...

Re: The Box, development tool, "Structural programming"

PostPosted: 12 Dec 2017, 13:00
by jdc
The initial objectives, are very simple:

Not going to start by re factor C library's, engines, or stuff like that because that is a lot of work to be done. Though in theory that is what i have in mind to do lather, apply the same principle for the language it self. But if people see it working on game functionality's first or other stuff think it will be more easy for them to understand how to apply that to a programming language.

Going to start simple by developing the "Character Generator", to handle a couple of things automatically, and see how things are evolving...

The previous picture (Character Generator) is missing :

Lists : all your characters that you have created. A section to load characters and to be able to edit them.
Location : where the character is or will be located, and to be able to move them to another location.

3D model management :

At this stage there is no 3D model management, but it will be nice in the future to have a working engine with the tool to be able to load and manage also the 3D model. But with out the engine it can only done by name. Still for example , get the list of 3D models and link one in to the character. But will have no clue if it working, with the engine we can see if animations, spells, abilities, etc... are working and link new ones or remove functionally from the character.

Re: The Box, development tool, "Structural programming"

PostPosted: 12 Dec 2017, 23:02
by dulsi
jdc {l Wrote}:Dulsi : it is stated clear that is done in C in Dropbox only contains files in C. But often project contains several languages. For example a database is made in SQL which have nothing to do with PHP or C. Engines like unreal have the core done in C++ and have biding's for Lua, or other high level scripting language.

Ok. But I don't see what that has to do with The Box. When announcing a project it is probably best to stay on that subject. If you want to talk about the merits of PHP or C or having other language bindings in a game engine, it is probably best to do that in another thread. I have now looked at your google drive. I still don't really understand what is The Box. Is it meant to be a game, a game engine, or some other development tool? You don't have a license specified for your code. In general I wouldn't include .c files with #include. Your suggestion of using 2 arrays to build lists of things is fine but most games store that sort of thing in data files now. That way you can modify the program without recompiling. There are times when combining the data into the binary is advantageous or necessary (for example my viobyte game needs to do so because the target platform is so limited).

Re: The Box, development tool, "Structural programming"

PostPosted: 12 Dec 2017, 23:58
by Lyberta
jdc {l Wrote}:Naaa is a proven fact debated on the forums that C++ or objects for that matter are slower. Objects are a entanglement of data, so they are bit far way for the zero and ones that the computer understand.


At this point I understand that it would be pretty much impossible for us to have meaningful discussion. I hope you can learn stuff so you can make useful tools in the future. I just leave it here.

Re: The Box, development tool, "Structural programming"

PostPosted: 13 Dec 2017, 08:50
by jdc
Lyberta :

I have to agree with Julius is necessary to move on, thanks for the contribute. People are more interested in the tool it self and development post's then in a debate about what people prefer.

Not sure if this forums allow that but in general conversation you can make a C++ (OOP) vs C (structural or procedural) post topic. For those interested in that kind of topic.

I post the differences so that people understand the 2 perspectives or languages paradigms, to be easy for them to follow along. And learn more stuff. Often when you are programming you have to know the 2 of them in order to work with several engines or frameworks. Not always you are working only with one.

I don't post the differences to start a debate.

Dulsi :

Thanks for support the license is open source, or public domain, why do you need a CC BY, don't think that is necessary if people want they can send you mails or other stuff like mention in the comments. If you want to make money of a open source project, thing that most people do is offer something free, a sample and have something pay. For example a free software with 1 or 2 extras paid. For art think is the same a couple of stuff open source if people lather need you well they are using already your art style is better for them to hire you to have the style aligned with the project.

The rest : i already have to much to hurry about the post. The themes on the post : "it is what it is". If you don't like you can search other project's, there are hundreds of topics that talk about their development. This one is my perspective on development. There are hundreds of perspective about development, hundreds of languages hundreds of frameworks, and so on...

Re: The Box, development tool, "Structural programming"

PostPosted: 13 Dec 2017, 10:03
by jdc
outated post...

Re: The Box, development tool, "Structural programming"

PostPosted: 13 Dec 2017, 14:57
by jdc
Implementation of interfaces

"Lips of Luna, the developer was asking for some help to re factor the engine code." Maybe this project will help in a way, think hes project sure will be for some help because is written in C.

I was wonder how to implemente interfaces in C...

In this link there is the code how Lips is doing it : https://gitlab.com/xenodora/lipsofsuna/ ... ain/main.c

Basicaly it works like a web framework does:

index -> also called bootloader -> loads other files. Commun called templates in to this file. (In C called the main.c file)
template_a -> loading screen interface
template_b -> game menu
template_c -> level 1

update google drive width the license, i will put also a lips backup there in case some one rember to errase the original. re structured the folders "structure".

note : i will need to digg a bit more to know how to do this stuff in C since some functionality of PHP is no supported in C. But still hope the theory posted is enough for people to follow along and learn how to do some things...

Re: The Box, development tool, "Structural programming"

PostPosted: 13 Dec 2017, 16:39
by jdc
Generic Animation Tool

Replay and based on Julius idea of a animation tool:

Fighting Game Quote

https://forum.freegamedev.net/viewtopic ... 303#p75303

"
I think it can be made by code, you can get a more perfect way of implementing them.

I try to animate in blender and is extremely hard to do, the result if often not that very good since it is separated of the code.

With that in mind i thought in do it with numbers.

Maybe you get more advantages :

Can do a very high amount of animations.

For them to be perfect, maybe by tweaking the numbers to it's details you get more smooth animations.

"


generic_animation.jpg


People what you think in animation with precise numbers?

Re: The Box, development tool, "Structural programming"

PostPosted: 13 Dec 2017, 16:45
by smcameron
i will need to digg a bit more to know how to do this stuff in C


Well, you aren't wrong about that.

No offense, but this thread comes off as slightly crazy. I don't think any C programmers have any desire to program C as if it were PHP. People who still program in C nowadays do so for a few reasons.

* They're doing low level stuff, and they need to control the hardware (e.g. set up virtual memory page tables themselves in a kernel).
* They are on a tiny machine with kilobytes of RAM and C is all that will fit.
* They have been programming in C for a long time and they simply like it -- they like simple imperative programming, they like doing their own memory management.

Note that the last reason is not a technical reason, it is simply a subjective preference.

You appear to be attempting to program in C somehow as if it were PHP, and to explain to other people how to do it (despite not appearing to be very good at either.)

This, for example, is utter nonsense:

How to handle variables ?

For example why to re declare pointers all the way in the project when we can have generic pointers declared :

int *int_pointer;
char *char_pointer;
float *float_pointer;

When we need to use them inside our files, we know that the structure have generic declared pointers. This is used in? A form of structure, so the template have this stuff build in. In your file you access the int_pointer.

Pointers are just a address to a variable they are not, a variable this means that it loads less stuff.

int large_number = 00987987987989890;

*int_pointer = large_number;

if we use our *int_pointer to pass it to a function, we don't move the variable around this is where we are saving resources. In our structure, we are saving lines of code by not re declaring stuff and by having pre build in variables.

Another pre build variable :

screen_width = 640;
screen_height = 480;

variables that :

why should we re declare this stuff which time we start a project?

This stuff should be a standard variable.



I think you should try programming in C for about 5 or 10 years and make some projects with it before attempting to explain to other people how they should use C.

Re: The Box, development tool, "Structural programming"

PostPosted: 13 Dec 2017, 19:05
by jdc
oudated post...

Re: The Box, development tool, "Structural programming"

PostPosted: 13 Dec 2017, 19:29
by jdc
back to theory, Shadder tool

I saw a video tutorial about a guy writing a shadder with shadding language and is one of those things that we could write a tool to manage that for us. Hard work to learn the shadding language for people who do not want to program.

shadder_tool.jpg

Re: The Box, development tool, "Structural programming"

PostPosted: 13 Dec 2017, 19:43
by jdc
Theory : Particle Tool

This tool i don't think is that easy to done it. It depend on a lot of stuff. Depend on images, sprites, others on 3D models, some in computer algorithms. But can be managed a with available libraries like Open Game Art. Have pre build in images, and add effects with the Tool. For some simple stuff i think is possible to have a Particle tool to handle this, at a simple level.

Often engines like unity 3D or Unreal engine do not have a standard particle format that can be used cross platform. That we could add more stuff with our tool...

particle_tool.jpg

Re: The Box, development tool, "Structural programming"

PostPosted: 14 Dec 2017, 06:34
by smcameron
jdc {l Wrote}:I use C the way i want, and i don't control other people topics. Nor do i make ironic comments, how to manage project's that i have no intention to help out. Talk comes cheap!

I was reading the forums, and seen this attitude before, people are doing some stuff that they like when others see some kind of competition, or project, they try to black out other people projects.

Great that this community try to help out others, and the administrators are active in looking in to this kind of situations.

I only appreciate constructive criticism and this one is not one of them.


Uh, I don't see you as "some kind of competition". Look, I've been programming in C since 1987. Based on what you've written, you seem like a novice at C. Very much so. I'm trying to tell you that as a novice, you shouldn't be offering advice on how to write C code. That's all. But if you insist, proceed. Just do not be surprised when people find your advice wanting. I'm trying to save you from further embarrassment. Not that you couldn't ever offer advice on how to write C code, but you're clearly not yet ready for that. (It's possible that you have some amazing new paradigm for C programming I'm too dumb to understand, but I don't think so, based on what I've read so far... e.g.

Pointers are just a address to a variable they are not, a variable this means that it loads less stuff.

int large_number = 00987987987989890;

Because that constant begins with 0, that means it's octal, so it's not nearly as big as it seems, and because 9 is not an octal digit, this doesn't even compile:
{l Code}: {l Select All Code}
error: invalid digit "9" in octal constant

If you intend to instruct others, you need to test your examples.

*int_pointer = large_number;

if we use our *int_pointer to pass it to a function, we don't move the variable around this is where we are saving resources. In our structure, we are saving lines of code by not re declaring stuff and by having pre build in variables.

What? On most systems nowadays (64-bit) an int is 32-bits and a pointer is 64-bits, so passing the pointer instead of the int is wasting memory at the very least. Passing a pointer doesn't make it any better. Not only that, why use the artificial "*int_pointer" rather than just:

{l Code}: {l Select All Code}
    my_function(&large_number);


You need to know at least the basics of C before you can instruct others, or write a reasonable library in C that you expect others to actually use. I'm trying to help you, not bash you. Spend some time with C, writing some programs, gaining some experience (years) before trying to tell people how to write C code.

Re: The Box, development tool, "Structural programming"

PostPosted: 14 Dec 2017, 21:54
by Lyberta
smcameron {l Wrote}:Based on what you've written, you seem like a novice at C. Very much so. I'm trying to tell you that as a novice, you shouldn't be offering advice on how to write C code.


He said that C++ objects are slow because someone somewhere told him that they are slow. At this point I just gave up. Here's another great video: https://www.youtube.com/watch?v=fX2W3nNjJIo

I couldn't find the segment by jumping to random points in the video right now but there's a part where Bjarne says that there is always one student that thinks that they know everything and start using pointers and stuff thinking that know performance while they're actually only starting and trying to solve problems that people already solved decades ago and the solutions are already in the standard library in case of C++.

Re: The Box, development tool, "Structural programming"

PostPosted: 15 Dec 2017, 12:56
by jdc
Theory for a standard level editor and open source map format

On thing that intrigue me is why there isn't a standard or open source format for the level map.

It's a very repetitive task to place stuff by hand, then to leave the engine and lose all that work. Do all that stuff again, annoying?

We could have a map in Unity 3D, Unreal E., blender and etc... that could save some serious development time. It probably increases also production by allowing several people to work in the same project with different programs. Maybe could also extend the functionally of 2D tiles render.

The format could do more stuff like save the object's position by numbers. We could load a map with a similar object position structure, and update only then necessary models and position's.

That "decopulaiton" or removing the dependency's of the objects it self with the position of the object could increase the production time.

For example we could see this files:

-> map editor -> standard format -> links to objects
-> map editor -> standard format -> links to object position

standard_level_editor.jpg


This also could save a lot of trouble since we no longer need to import things to our project, instead our project works with the existing library's.