The Box, development tool, "Structural programming"

The Box, development tool, "Structural programming"

Postby jdc » 09 Dec 2017, 10:40

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.

Think you can only code properly in 2 ways or in OOP or in a structure. This is to do with logic. If you study Philosophy they claim there are only 2 possible ways of logic. General to singular, and singular to general.

A structure is general to singular and OOP is singular to generic.

"Programming in Procedural people thought is not doable but it is. No one come up with the theory."

How do we build a structure ?

The concept : "The structure is build by decopulating stuff in to Singular.", or "by separating things".

The main file is build in a generic approach so that others can attach to the generic structure.

You can see the same in a Data Base. Several topic's are connect to a generic or master, or thy are connected throw individual parts to form a generic approach.

Several connections resembles OOP this is possible because they are connected by them self's in isolation.

In a structure every things are open and accessibility you can always access all kinds of variables. If we analyse the original creator of C, it made all stuff general, so it can always be accessible. In a way he was thinking in GTS, lather people though STG was better. I have write a article debating the 2 of them. (Think it will be in the comments lather)

How are build Variables ?

A screen with variable why should it be something like scr_wth, sreen_w. People adopted this kind of variables names which make readability and understanding of whats going on very limited. How about we called it "screen_width" very clean and understandable? The "_" symbol stands for a space in computer language.

The next file that calls scr_wth, well when is of the context of the screen with, can you still remember that scr_wth is actually the screen with? And if you lather create something that is gm-wth, after several names like this one you will still remember that scr_wth is meaning screen_with? People that start to work on file , they know what a scr_wth means?

Who says screen_width says blue_team : b_t and r_t , translantes to blue_team and red_team?

Let's says you have a memory problem lather is still possible to read the code? Hardly? That happen to me and i realize the importance of variables that you could understand them no matter of what happen.

There are many more reasons why clean variables is the proper way to work with them.

"The Implementation, automation and Artificial Intelligence. It will be dependend on clean variables."

How are build Programming Templates files ?

Functions another thing which at the moment is not designed to be part of a structure. For example a file that handles score or team score, why it will be mixed with all this kind of other stuff, logins, movements and so on... If we separate them by types, lather we can separate them by categories. So we can create sub divisions of the same. Separations allows more separation.

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

Different games, have different team styles and needs, so if we use proper file separation and variable name build in a structural way, when we want to implement a new game we just need to tweak a programming template a bit here and there and is done.

How to implement Others library's ?

Since the game is open source it could also have pre build with game engines or library's. Since we separate our code so far in 2 categories, we can easy add a third separation.

team_rts_SDL
team_rts_OGRE3D
team_rts

In this case we have the same file, but using other languages and external engines or library's.

The separation files reads as : a team "handler" for a RTS game done in SDL or in Ogre 3D. With other Option to build in native code.

The AI Language and extension?

So now how do we implement Artificial Intelligence with a structure? Once again with the same principle of separation or layers.

-> programing file
-> temporary : A.I. File
-> temporary : human redable snippet
-> temporary : human redable

The tool will create AI separted files for interpretation and redability. So instead of you debuging the PHP file you debugg the AI file with the help of the AI. So you can debug in several layers, it could in theory reach the machine code.

The AI create this files and operates this way : machine code -> assembly -> c -> AI language -> human redable snippet -> human redable.

This will be possible for the AI do get patterns, and find errors in the code, also for humans to code in a more efficiente way.

The ai will handle the debugging for us with use of layers file.

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 ?

This tool will make possible the use of library's. At this moment for example we have all this scattered Art in "Open Game

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 will have a already 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 ?

In this sketch you can see how this stuff could be organized. Several pre build in icons, that have their name standardize in order to work with the code.

The same can be applied to spells lists, icons, interfaces and so on.

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

"Like a Photoshop have evolved the better you work the more tools you have available?"

open_engine.jpg


Payment or help in Development ?

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.
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 09 Dec 2017, 10:43

The engine will be build in C, since it can reach better performance with the use of pointers. So i will be posting some stuff related to how this stuff is implemented.

Since people never worked with this concept, and i already work with it for some time, think it is easy for them so see some live examples.

It is on google drive for now, is public : https://drive.google.com/drive/folders/ ... sp=sharing
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 09 Dec 2017, 10:56

Arrays in C i like them because they have a lot of performance. PHP implemented index for arrays which make your live very easy, how can we do the same in C?
Well they are not automated was in PHP we have to do that by hand, with array index.

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.

This for is very good because any language can read it. If you need to import it in to any kind of other programming language, it will be not big problems. For example in Unity3D i have my lists build this way and they will work the same way in the engine.
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby Lyberta » 10 Dec 2017, 02:43

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.
Some crazy person on the Internet.
User avatar
Lyberta
 
Posts: 372
Joined: 19 Jun 2013, 10:45

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

Postby jdc » 10 Dec 2017, 11:37

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...
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby Lyberta » 11 Dec 2017, 05:40

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.
Some crazy person on the Internet.
User avatar
Lyberta
 
Posts: 372
Joined: 19 Jun 2013, 10:45

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

Postby jdc » 11 Dec 2017, 15:54

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 .
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby Julius » 11 Dec 2017, 17:25

Let's not make this into a "my favourite programming language it better than yours" discussion, please.
“You never change things by fighting the existing reality. To change something, build a new model that makes the existing model obsolete” - Buckminster Fuller
User avatar
Julius
Community Moderator
 
Posts: 2078
Joined: 06 Dec 2009, 14:02

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

Postby dulsi » 12 Dec 2017, 01:37

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.
dulsi
 
Posts: 94
Joined: 18 Feb 2016, 15:24

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

Postby jdc » 12 Dec 2017, 11:56

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.
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 12 Dec 2017, 12:06

Let's see if i can make a development post.

With a live example it maybe is more easy to understand the concept. Lather i resume the theory :

So by having the character generator we can see how the structure works, now we can generator all aspects of our character, by creating the files for the character. I guess is similar to OOP but is done outside the programming language. While OOP is inside the programming language.

You can see in the pictures the Tool will create or handle the dependency's for us. So instead of us hard code a character files, which lead to bugs and errors the tool will generate the files standardize for us. Helping in 2 ways, one is a "tool" it self like name generator imbued and the other the files generation automaticaly.

The file output then can be done to any kind of language and in any kind of format for example: Unity3D C# language and in array's.

It will be more easy to work, because for example you do not need to enter the engine to work. You can go to your character, and let's say update name, strength, and dialog's. Click and is done.

character_generator.jpg
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 12 Dec 2017, 13:00

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.
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby dulsi » 12 Dec 2017, 23:02

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).
dulsi
 
Posts: 94
Joined: 18 Feb 2016, 15:24

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

Postby Lyberta » 12 Dec 2017, 23:58

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.
Some crazy person on the Internet.
User avatar
Lyberta
 
Posts: 372
Joined: 19 Jun 2013, 10:45

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

Postby jdc » 13 Dec 2017, 08:50

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...
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 13 Dec 2017, 10:03

Let's continue with the development, back to the theory :

How to handle dependency's ?

If we use a standard C library with 1700 lines or code or something like that to handle the library, that stuff is loaded, all in to a scene or a game level.

Let's say that our main menu only uses JPG, then we need to load JPG's, PNG, PSD, and so one so if we handle this stuff using this principle. We load the image.c and the jpg.c which handles the necessary stuff and only loads the necessary stuff.

example_dependencias.jpg


*Not to do things this way causes problems, which where debated in the first part of the posts, a previous example : like if you have memory problem. It will be easy to see the dependency's of the JPG library because you only need to read the image.c. While if you have a mixed library it may break stuff start altering things around. Which translates in a lot of hours of coding and debugging.

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.

We know that no matter what all application's use a screen_width, and screen_height unless we are developing more complex stuff for example robots, but in that case we can have 2 templates, 1 for applications and 1 for direct accessing code.

Once again we find to benefits, one is this stuff is going to be used or reused again. Another thing is the standardization, if we need to declare or import a function lather, it can be a function generic because it is accessing generic variables.

Preventing of declaring new stuff saves, coding time. Because lather you have to handle the dependency's. If they are already set this minimizes mistakes and error's inside the code.

To use this variable it not necessary to be the language it self often can be a database to make a automatic application for example, it can use the code template. So it save us development time to have pre build in templates.

People are starting to explore this kind stuff now with the : bootstrap. A CSS kind of framework or standardization that reclycle's stuff. If you want to know more about it can find it in: https://www.w3schools.com/

"I found this stuff a couple of years ago, when i was designing my PHP framework before . "

How our main file could look like ?

It looks like a OOP object with the exception that all things are generic and accessible. The difference is that a variable or a library is only needed several "layers" down or in another application is loaded there. If it generic and most of the things or several files need to load this stuff is moved to the top level.

{l Code}: {l Select All Code}
/* FUNCTION LIBRARY */

//#include <errno.h> // handle erros, not stable
#include <stdio.h>  // header defines three variable types, several macros, and various functions for performing input and output.
#include <stdarg.h>
#include <stddef.h>  // ptrdiff_t on osx
#include <stdlib.h>  // Marcro extension library
#include <string.h>  // header defines one variable type, one macro, and various functions for manipulating arrays of characters.
#include <limits.h>  // limits the values of various variable types like char, int and long.

//provides a macro called assert which can be used to verify assumptions made by the program and
//print a diagnostic message if this assumption is false.
#include <assert.h>
#include <arm_neon.h>
#include <windows.h> // Handle the windows interface

/* GAME LIBRARY */

#include <file.c>
#include <spells.c>
#include <character.c>
#include <game.c>
#include <resolution.c>
#include <movement.c>
#include <keys.c>

/* GAME VARIABLES */

bool admin = 0 ;
bool game = 0;
int done = 0;  // The window is open: enter program loop (see SDL_PollEvent)
screen_width = 640;
screen_height = 480;

/* ========== Pointers ================= */

int *int_pointer;
char *char_pointer;
float *float_pointer;
FILE *file_pointer;  // This declaration is needed for communication between the file and program.

// Debugging and re-factor or re-writing code.

int main(int argc, char *argv[]){ // argc, e argv default?



}
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 13 Dec 2017, 14:57

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...
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 13 Dec 2017, 16:39

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?
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby smcameron » 13 Dec 2017, 16:45

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.
smcameron
 
Posts: 222
Joined: 29 Oct 2010, 23:44

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

Postby jdc » 13 Dec 2017, 19:05

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.
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 13 Dec 2017, 19:29

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
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 13 Dec 2017, 19:43

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
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

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

Postby smcameron » 14 Dec 2017, 06:34

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.
smcameron
 
Posts: 222
Joined: 29 Oct 2010, 23:44

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

Postby Lyberta » 14 Dec 2017, 21:54

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++.
Some crazy person on the Internet.
User avatar
Lyberta
 
Posts: 372
Joined: 19 Jun 2013, 10:45

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

Postby jdc » 15 Dec 2017, 12:56

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.
jdc
 
Posts: 44
Joined: 29 Jun 2017, 16:48

Who is online

Users browsing this forum: No registered users and 1 guest