The Box, development tool, "Structural programming"

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

Postby jdc » 20 Nov 2018, 10:04

Now are are we looking in this projects?

Something like this file:

https://gitlab.com/KilgoreTroutMaskRepl ... rc/mouse.c

Well written, with variables on top. It is not documented, it will be hard for any one coming to this file to understand what's going on. But the principle is there.

Clean code that we can work with.

Document the code : what connections is using, what and why is using some library's, if possible not to much explain the code (not redundant). If is to much redundant i will become also very hard to work with. Because you are reading the code and the documentation.

If is not written this way then the process will be to refactor, parts of the code to look like this way. Simple organized and documented (simple). To make it more easy to work with and learn.
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 20 Nov 2018, 12:17

The project map :

In google drive we have this new file, that explain all parts of or creating a new game/aplication in C. If the software is not working at least some one can start using it was a tutorial. It have all the library's to assemble a application in C.

https://drive.google.com/drive/folders/ ... ugL7glslMk

External_projects :

- masters of orion clone (https://gitlab.com/KilgoreTroutMaskReplicant/1oom)
- Lips of Lune
- Quake 3 engine (https://github.com/id-Software/Quake-III-Arena)

External_libraries :

- Stb, image library ( https://github.com/nothings/stb)
- Zlib (https://zlib.net/)
- Libpng (http://www.libpng.org/pub/png/libpng.html)
- Expat, xml parser (https://github.com/libexpat/libexpat)
- GTK+ (https://www.gtk.org/download/windows.php)
- Font, framework (https://www.freetype.org/)
- Fontconfig, configurring and customizing font https://www.freedesktop.org/wiki/Software/fontconfig/
- Glib, https://developer.gnome.org/glib/
- ATk, Access interfacces (https://github.com/GNOME/atk)
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 20 Nov 2018, 15:31

Think i will opt to start having something working before go in to heavy code refactor, that way the software is already working and doing something... (lather analyse that better...)

I will opt with GTK+ it seems pretty simple in this tutorial, (only a couple Labels), for the menu. Is open source, can develop a very powerful application (2D).

It have that procedural linking style, which i like to work with, and is very simple.

This cover the loading of images in to the software, "external library'"s.

If you want to follow there are a tutorial in the video. With the GTK can start building the menus for the program, and putting something working.

https://www.youtube.com/watch?v=ajNvsv1ka4I

For the 3D think i will use OpenGL, because it uses the same principle was C, it's cross platform, and can work width a minimal graphic quality.

For the OpenGL it seems is necessary "Glut", it have a similar style was GTK.

https://www.youtube.com/watch?v=3aJ8OR1 ... G3rF99gkvk

Maybe can use both Glut+GTK to have more functionality available.
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 20 Nov 2018, 18:02

Forget a step in the planning of the software :

It need a listing of the stuff that we added to the game. Thought that is needed to see it in 3D but thinking better is not 100% need. The software can work only was a linker of stuff. It already removes a lot of work for people. Is not needed to touch the code for this. But to do complex editing will be needed to load models in to the software.

For simple stuff : Unity3D for example, if you add the files to the assets folder when it loads it handles them. So is not 100% necessary to manual import them... But the software can be configured to edit the files manually to work with any other software. Removing the need for artists/editor's to know code and touch the code.

Can add/edit things in the game throw software only (interface).

listagem.jpg


We can see in the image all the characters that we added to the game.
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 24 Nov 2018, 14:05

Also remember another thing that we could add to the software is a debug, implement some kind of test's so we can minimize more the margin for erros which translates in more development time.

For who is following along we are at GTK, they recomend to install mysy2 if on windows (don't imagine many ppl using linux):

https://www.gtk.org/download/windows.php

Install msys2

http://www.msys2.org/

then GTK recomend we get glade.

https://www.youtube.com/watch?v=vOGK3TveDDk

which i check what it is, is a graphical software to develop the app so we can develop something whitch just a few clicks.
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby Lyberta » 24 Nov 2018, 18:50

jdc {l Wrote}:(don't imagine many ppl using linux):


I'm pretty sure for most people on this forum GNU/Linux is the only OS they use.
⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧
User avatar
Lyberta
 
Posts: 615
Joined: 19 Jun 2013, 10:45

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

Postby jdc » 24 Nov 2018, 22:02

Good for them. Lyberta

The Box Interface taking shape in "Glade". Now the problem will be to manage the interface. Tweak the tools in to a usable interface.

the_box.jpg
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 25 Nov 2018, 09:53

Think i whant to lunch the software in a Linux packaged format.

So when the users download the software it already have a few games to tweak. This will be depende on game administrator if they want to cooperate it will take to much time for me, to get to know all this games.

A possible list :

- Ancient Beasts
- Open Dungeons
- Lips of Luna
- Masters of orion
...

don't know what other games are active, but it could be a large list. Or when the user install the software we can see a list of game that work with "The Box" and can download them.

Ancient beasts is a online game, but the software can come with a Apache and run it locally, so people can play around,
Don't know how Open Dungeons works but think is a local game.

Will see if clone games can be included in to have a large game list.

Also develop more tools to help out with this.

I was a Ultima Online player for good amount of years. Now if i want to play don't know where the community is.

Maybe create a server tool : which we can add and remove servers. Not just for one type of game but for all games :

Something like this status:

Unreal target (game) Lyberta (administrator/s) offline (status) 2 days (time to be active/reseting) .
Ultima Online (game) Lyberta (administrator/s) offline (status) 1 days (time to be active/reseting) .
Ancient Beasts (game) Lyberta (administrator/s) online (status) 0 days (time to be active/reseting) .

If you have or want to create costume server, like Ultima Online or Ancient Beasts, we can add it to the list and people will know where your server is and how to connect.

This will allow for example when a user download Ubuntu see the software, and install get a access in to a large working package. Think it will be nice for Linux users, to have a short cut in the exploration of open source games, and it will be nice for the developer which will have a much larger community for their games which could represent more help and support to this projects.

--------------------------------

The tool list (debate):

Servers (mention)
Debugg (mention)
Database (make some games that are online work with it)
Name Generator (robust name generator included, to help create characters auto.)
WEb Browser (local server)
Tile Manager (i will be nice to have also a tile manager working, so to load imagens/icons and check how they look)
Map Manager (debated already)
3D editor (based on shapes, debate)
... (not much time for this now)
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 27 Nov 2018, 11:20

Was managing Lips of Luna project, and realize it consumes a lot of time if things are not organized, since i worked with Adobe Bridge which is an advanced browser or explorer files tool i thought on adding and developing a tool that do something like that to "the box". It can administrate files, do several projects in the same, time and do more elaborated tasks, display more information. Etc...

(images are compressed under 100kbts)

Several channels file browsing

file_browser1.jpg


Edit on the software the files

file_browser2.jpg


Have files working with the software programming language

Bridge interface

bridge.jpg
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 27 Nov 2018, 13:46

How to do the automatic programming? think i come up with a solution to do it.

Think on "actions" :

You choose, a action that want to do and is supported by the "programming simulator enviornment", let's say you want to get all your spells from the database in a mysql extension. Select the action for that, and it loads a menu that have the pre build in functionality in to the interface. Only readable text (not programming functionality)

So is modular enough to handle all kind of actions, and simple to program, and support several languages. Then the software recognizes you choose C, or PHP, get the rules to build a command like that : PHP -> mysql -> db -> spells -> call) and assemble the call automaticaly.

pse.jpg
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 28 Nov 2018, 16:21

How all the open source project's could be loaded in to a Database and then loaded in to the software. Width specific details about them, who develops, what the community think about the project (ranking), download them auto (create a command tool to do this), auto compile for linux, etc...

Any suggestions on how to improve are welcome.

About the post's : the images are extremely compressed but if there are any problems with the server think i can move the project to a Facebook page, if is causing any problems.

projeccts.jpg



Was for the compiler tool : (make files auto) is something interesting to automat, in this case i have no experience with building files for Linux i did it 5 or 10 times. Most of the times was running only a command. To manage them with files programming, don't know what will be needed to do it. One think it needed to be connected to the GCC probably to be able to create the .exe or execute in Linux. I think it compiles differently in different Linux distro's. And the make files is just a linker. It is linking stuff. So the management to be done in the software is something like that, manage files to be linked. (guessing)

compiler.jpg
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby smcameron » 03 Dec 2018, 01:07

"smcameron", not "scamerson". Ranking 0.1 out of 5? Ha. Nice burn.
smcameron
 
Posts: 303
Joined: 29 Oct 2010, 23:44

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

Postby jdc » 12 Dec 2018, 11:02

smcameron lol

This week i was extremely annoying with publicity, like in a 1 hour video they put 1 publicity in which song. In a concert of 1 hour, 20 or 30 musics you need to listen to 20 or 30 publicity'. This in Youtube and Facebook is not getting better... (ad bloquer not always work, some times they disable the web page if you use one.)

Then I thought why not add a social tool to the box. When you develop something you can publish and be directly online, and the followers or other users can see what you post, like a internal internet or a mini network.

A display page listing users (follow, contact, page, tags, etc...)

social_tool1.jpg


A display of a user page

social_tool2.jpg


How this works ?

A torrent server, to connect people and users upload stuff to other users. Some text, and images, links (maybe videos) with today internet connection will be no problem.

How to implement?

Will be needed a database to mount the structure of the page (style), link users, etc...

benefits ?

We can create our social group free from publicity and spam and administrate the way we want.
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 07 Jan 2019, 14:13

Lunch a 0.0.1 version, is not a version is just a structure. If i can have things ready i will lunch 0.1.1 a working version.

The files i'm working are in google drive public folder, (some code are from other projects is there just to know how thing are done) https://drive.google.com/drive/folders/ ... ugL7glslMk

what is PHP ? - Hiper text Preprocessor Programing Language.

This means that PHP way of doing things can only be replicated with the Preprocessor which in C are the .H files.

For what i read C is a single treat language you only have main() to work with.

The structural programming can be achieved with this:

main (){
include "image.h"
include "image_JPG.h"
}

For what i tested both files .h can communicate with which other. The ".c" extension can't access which other files.

The .h files need to be in main, to work with variables, because of the single treat thing. People for what i read advice not to use variables inside .h but only declare them. This way we can use files like in PHP.

image_jpg.h is inheriting successfully from image.h

add a Patron page so ppl can contribute with $$; https://www.patreon.com/user?u=16271332

We can see now a structure in the main. Looks is like a configuration page. (is Tweakble in the code or lather outside with a interface.)


{l Code}: {l Select All Code}
   main(){
   #include "application_structures\time.h"
   #include "application_structures\error.h"
   #include "application_structures\file.h"
   #include "application_structures\string.h"
   #include "application_structures\paths.h"
   #include "application_structures\database.h"
   #include "application_structures\image.h"
   #include "application_structures\image_jpg.h"
   //#include "application_structures\image_png.h"
   //#include "application_structures\image_gif.h"
   
   #include "application_structures\sound.h"
   #include "application_structures\keys.h"
   #include "application_structures\resolution.c"
   //#include "application_structures\interface.c"

   #include "application_structures\model.h"
   #include "application_structures\model_textures.h"
   #include "application_structures\model_animation.h"
   #include "application_structures\model_particles.h"
   #include "application_structures\model_bounds.h"    //colision, triggers
   
   #include "application_structures\model_blend.c"
   //#include "application_structures\model_DAE.c"
   //#include "application_structures\model_FBX.c"
   //#include "application_structures\model_OBJ.c"
   
   #include "application_structures\camera.h
   #include "application_structures\camera_RTS.h
   //#include "application_structures\camera_FPS.h
   //#include "application_structures\camera_2D.h
   //#include "application_structures\camera_3Person.h
   
   #include "application_structures\print_screen.h
   

   #include "application_structures\movement_RPG.h"
   #include "application_structures\movement_Vehicles.h"
   
   #include "application_structures\AI.h"
   
   /* GAME STRUCTURE LIBRARY */
   
   #include "game_strutures\game.c"
   #include "game_strutures\money.c" //timers
   //#include "loots.c"
    #include "game_strutures\spells.c"
   #include "game_strutures\abilitys.c"
   #include "game_strutures\items.c"
   #include "game_strutures\items_sci_fi.c"   
   #include "game_strutures\items_rpg.c"
   #include "game_strutures\items_fantasy.c"
   
   /* TEST LIBRARY */

   //#include "variables_interface.c"
    //#include "interfaces/interface2.c"

   if (debug == 1){
      //fprintf (stderr, "%s:%d: %s: Assertion `%s' failed.\n", error_file, error_line, error_func, error_assert);
      //abort ();
   }

   printf("Choose interface : ");
    scanf("%s", str1);

   printf("Enter interface : %s", str1);

   interface = atoi (str1); // Convertes the string to a integer
   
   /*
   
      TOOLS LIBRARY
      -Interfaces can be in .c since they do not delegate any to other files.
      -The previous .h files cam delegate to .c files.
   */
   
   if(interface == 0){ // Main Menu
      //printf("Main Menu loading");
      
      #include "interfacces/main_menu_GTK.c"
      //#include "interfacces/main_menu_SDL.c"
      //#include "interfacces/main_menu_Free_GLUT.c"
   }
   else if(interface == 1){ // Character Creator

      //printf("Character Creator loading");

      #include "interfaces/character_generator_GTK.c"
   }
   else if(interface == 2){ // Shadder Tool
         //printf("Interface2");
         //#include "interfaces/interface2.c"
   }
   else if(interface == 3){ // Map Editor
         //printf("Interface3");
         //#include "interfaces/interface3.c"
   }
   else if(interface == 4){ // Variable Manager
         //printf("Interface3");
         //#include "interfaces/interface3.c"
   }
   else if(interface == 5){ // Generic Animation
         //printf("Interface3");
         //#include "interfaces/interface3.c"
   }
   else if(interface == 6){ // Particle Tool
         //printf("Interface3");
         //#include "interfaces/interface3.c"
   }
   else if(interface == 7){ // Particle Tool
         //printf("Interface3");
         //#include "interfaces/interface3.c"
   }
   else if(interface == 8){ // Level Models Position
         //printf("Interface3");
         //#include "applications/the_box/levels_models_position.c"
   }
   else if(interface == 9){ // Level Editor

         //printf("Interface9");

         //#include "applications/the_box/levels_models_position.c"
   }
   else if(interface == 10){ // Database tool
         //printf("Interface9");
         //#include "applications/the_box/levels_models_position.c"
   }
   else if(interface == 11){ // Options
         //printf("Interface9");
         //#include "applications/the_box/levels_models_position.c"
   }

   system("cls");
   system("pause");

    return 0; // Zero indicates success any other failed
}



The point of this is , if some one code a camera_RPG for their game if using a inheriting structure, can be use in your game also. A waste of time we all have to program that rpg camera again and again.
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby Octavekman22 » 07 Jan 2019, 15:13

I want to know about structural programming
Octavekman22
 
Posts: 1
Joined: 07 Jan 2019, 15:12

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

Postby Lyberta » 08 Jan 2019, 11:20

jdc {l Wrote}:For what i read C is a single treat language you only have main() to work with.


Actually, ISO C supports multithreading since C11. But most people who write C still fallback to OS API for threading.

jdc {l Wrote}:For what i tested both files .h can communicate with which other. The ".c" extension can't access which other files.


#include directive is just textual inclusion. You can access stuff that was declared before in the same translation unit (read: .c file).

jdc {l Wrote}:The .h files need to be in main, to work with variables


You can use dependency injection to pass pointers to variables you need.

Octavekman22 {l Wrote}:I want to know about structural programming


Here: https://en.wikipedia.org/wiki/Structured_programming

Basically, it's a very old paradigm that produces unreadable code mostly because of ban on early exits.
⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧
User avatar
Lyberta
 
Posts: 615
Joined: 19 Jun 2013, 10:45

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

Postby jdc » 09 Jan 2019, 07:17

Lyberta

din't know the concept already existed and using the same name lol. I didn't read the theory, just got it from programming. My first post called it something different, then get in to this name when i mature the concept.

But one thing they got it right in the Wikipedia article, is allow to use less functions and much more if/elses, which your code become simpler.

Octman

A practical example on the inherit.

image.h -> Contains the stuff that repeats. Variables and functions. For example the height and weight repeats in the other 2 files. A compress image function, may also repeat in the other 2 files.

image.h -> repeat variables and functions
image_JPG.h -> receives variables
image_PNG.h -> receives variables

image.h
//image_JPG.h
image_PNG.h

in this way we have less code, and can comment any library that those variables are still there. If we comment image_JPG there will be nothing there that affects our system, because we put the repeating stuff in to image.h, and they
don't collide, because both are using the same structure the "image.h".

Often we can use just use if and else, because of the inheriting, the variables are at image.h with default defaults, is just a meter of doing simple test with : if and else.

In may PHP code, i removed a great amount of functions in to if/elses.
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 11 Jan 2019, 00:58

How a function will look like:

Thought that it may be something like this (functions, and files) :

save.h
save_rpg.h
save_sci-fi.h

but it may end be just something like this, much simpler (1 variable):

{l Code}: {l Select All Code}

bool save = false; // inherit from save.h or other file, since is doing to little

if(save == true){
   
   int models = 0; //save this variables
   int level = 0;
   int equipment = 0;
   int skills = 0;
   int spells = 0;
   int user;
   
   FILE * fp; // writte to a file or a database
   fp = fopen ("c:\\temp\\1.c","w"); /* open the file for writing*/
   for(counter_1 = 0; counter_1 < 10; counter_1++){ /* write 10 lines of text into the file stream*/
       fprintf (fp, "This is line %d\n",i + 1);
   }
 
   fclose (fp);/* close the file*/
   save = false;
}


Since every thing is inherit, there is no point in writing a function, this goes in to the game while loop. once something activate save to true, it saves.

Never get to a point where this stuff get to 1000 lines, when we need to add something it become a bit of confusion, but if get to that not sure how it will be improved. But probably will not get to that since must of the code is inherit, when we get to the lower levels there is to little code.
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 15 Jan 2019, 10:51

Octam, Lyberta, maybe scaremorn...

"For the people that are interested in he project:"

Add the files : main_menu_GTK.c, gtk.h, characer_generator_RPG, inerface_main_menu.xml, information.txt, creator_tool.

main_menu_GTK.c -> to start which will just attempt do load a starting menu. Maybe it will be nice o have some options to start with.
gtk.h -> a costume delegater to main_menu_GTK.c and lather maybe more functionality (Variables and function delegator).
character_generator_RPG.c -> this will have a lot of : for example races, let's say we can come with 100 races. though on adding a rooster to races, so it will be easy to create new races. Also will have all kind of stuff in a
character_generator_RPG.c -> If some one need to mount a characer or a team will have every thing in there, just click and it will load all that stuff in to the files. Also can also be used to add NPC's to the game. Maybe link races, to a raw 3D model and a 2D image. Rooster and if possible a 2D race image.
inerface_main_menu.xml -> GTK can load xml files in to interfaces. I was reading the manual, but a lot of stuff is in code directly.
information.txt -> the jason or xml files are very heavy, in terms of reading a file with 12.000 lines. It didn't load in to my PHP server. So thinking in creating a simpler set of tags, then create the rules in C, to work as a xml or a jason file but in a .txt file. So we can have a file that accept text but is much more light heigh in loading. (Maybe add less characters to the files "tags").
creator_tool.c -> At this stage don't know how practical is to add stuff automatically to files. But what will do is add for examples races to files.

https://de.wikibooks.org/wiki/GTK_mit_Builder -> Found the manual on GTK3 is in German but it can be translated easily. (google translate or Crome translate page)

A "First" delegation to main:

FILE * FILE_pointer -> This line repeat in several places. It needed to be inherited. The explanation on how this works can be found in there. Still i documented on main.c, if some one look at the code: know what is doing. -> https://www.cs.bu.edu/teaching/c/file-io/intro/

Things to do:

-> adding races, if you need to add a race, just go in to he file, character generator rpg -> races -> races . (spells, items ...)
-> linking races to models, (at the moment didn't though on how to do this)
-> loading menu (options for : sound, shortcuts, load a game or the software).
-> Delegate to main (a bit abstract but this is how it works, our structure inheriting when possible, avoid repetition, principle of DRY can read about it).
-> create_tool.c (add rules, to add stuff automatically to files)

files and files locations:

game_information/elf.txt : information on the elf race rooster, will serve was a base to add races. taking the information out of this site was example :
https://forgottenrealms.fandom.com/wiki/Elf

interfaces/main_menu_GTK.c : a starting or loading menu.

tools/character_generator_RPG.c : default info to add characers.

external_librarys_structures/gtk.h : a delegator to GTK functionality.

interfaces/interface_main_menu.xml : GTK load xml to interfaces.

tools/creator_tool : add information to files automatically, maybe do other stuff like linking (models, images).

optional Links :

https://www.aidedd.org/dnd-builder/index.php?l=1 -> some information on how to build characters.
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 29 Jan 2019, 08:12

I see a lot of interest of people in coding, but not that many are successful in doing some programming or learning.

I think the main aspect of programming is learning how to debug code. Because most of the problems are related to conflicts inside the code.


There are probably many approach to debugging was there is to programming.

But this is how i do it.

I separate the code in to library's, not just to do better programming but also to do better debugging.

I this error in c : "unexpected token in variables", since i read the tutorials and have some experience in programming i already know that is not related to variables.

how did i debug this error and in general?

I move the code to a smaller environment. like the file main_tests.c which i now updated it to the google drive project.

in the file you can post the stuff related to what you are doing.

For example if you are working with images. Post only image code.

"variables"

image.h
image_JPG.h

"functions"


So now you have only image related code in to do tests in 2º main file. In this case It will output no error because it was not related to variables.

In this way you can code like i do, can code large amounts of code, then debug bits. If you are not doing like this you need to program first and plan lather. But you need to plan first code lather. To have a better code need to plan first and prevent from having unmaintainable code.

This style of coding is good for debugging since every thing is modular, can test only the needed parts.

Is this need?

Compilers often send weird errors not always is related to any thing
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby Lyberta » 30 Jan 2019, 06:37

The idea is that you compile each cpp file separately.
⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧
User avatar
Lyberta
 
Posts: 615
Joined: 19 Jun 2013, 10:45

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

Postby jdc » 04 Feb 2019, 06:06

Lyberta

all stuff is linked if you read the Make file in C it is linking stuff. High level languages have automated way to this stuff, in lower level you need to do all stuff by hand. So when people say to me that a lower language does not work in a way, it is much more likely that you make a low level language work the way you wanted then a high level language because. A high level my already have a very high level of nested stuff. In a PHP framework i could't even add a array unstructured to the framwork. It only handle logic connected stuff. That's why frameworks are so heavy they add layers of processing to the raw stuff, also hard to learn because they created a new set of rules.

Stuff that i added to the project:

windows.h -> handles a basic windows in a procedural way.
STB image -> this library have image handling in procedural code, working on to separated in to the image.h, image_JPG.h etc...
Attempting o see if Ogre3D could be use for better graphics, but they say it needed to speak to C which is no implemented.

this post address that issue.

https://forums.ogre3d.org/viewtopic.php?t=63153

Maybe use horde3D which have a way to communicate with C

A example on ho to convert code variables "structures" to the box general structure

{l Code}: {l Select All Code}

enum ITEMTYPE
{
      MI_PARENT, MI_ACTION
};

struct MENUITEM {

      enum ITEMTYPE type;
      char *name;
      char *helpstring;
      void *p;
};

struct MENU {

      int vertical;
      char *name;
      int left;
      int top;
      int right;
      int bottom;
      int count;
      struct MENUITEM **menuitemlist;
      int curritem;
      struct MENU *parent;
};

char menu_item_TYPE; // Actions : MI_PARENT, MI_ACTION
char *menu_item_name;
char *menu_item_helpstring;
void *menu_item_p;

int menu_vertical;
char *menu_name;
int menu_left;
int menu_top;
int menu_right;
int menu_bottom;
int menu_count;
struct MENUITEM **menuitemlist;
int menu_current_item;
struct MENU *parent;


we convert it to better named variables, and put actions in to comment's.

It removes redundancy, simplifices, and is easy to add and remove things in the code.

In here we removed 4 lines with 1 enum less.

2 lines from a nested menu item structure.

2 lines from a nested menu item menu.

the linking variables part is no implemented.

This is to show how the code reads better.
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 04 Feb 2019, 11:05

Some one may ask how do we do 2 menu items or more if we only have one set of variables?

Reuse variables.

{l Code}: {l Select All Code}
menu_height = 50
menu_width = 100
menu_color = gray
menu_text = options

function load_button()

menu_height = 50
menu_width = 100
menu_color = gray
menu_text = links

function load_button()

if things repeat we can even do :

menu_height = 50
menu_width = 100
menu_color = gray
menu_text = options

function load_button()

inherit previous style
menu_text = links

function load_button()

*No variables are passed to functions. It is very problematic and hard to maintain and read. In this case if you need the variables just need to consult the inherit variables page.


menu item 2 only is needed to load when menu item 1 finishe loading. In programming things are not loaded at the same time.

lets see a structure if we repeat a structure with 30 variables which time we load a button, for 2 buttons that is 60 variables. For a large menu with 300 buttons thats 9000 variables, unused and loading high amount of uneeded stuff to memory.

struct.menu_height
struct.menu_width
struct.color
struct.text

which time is declared 2 new structures to which button. It seems more reusable, but it may be a bit more heavy.

If is need to track on some kind of variable for the buttons is declare individually for which button. In this case this could be a structure if it become to large.

{l Code}: {l Select All Code}
visibility_button_1 = off
visibility_button_2 = on


Individual variables

Only the needed stuff will be loaded.
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

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

Postby jdc » 24 Jul 2019, 17:42

The database concept.

Separation of the database engine to array format.

in our array db we can automate the db calls in programing. To build high complex relations lather.

by creating a array stucture with the rules then we can create new rules. was we need them. Which can help see the relations, which we can't if they are already in a engine format. Also allow to use bette with seveal engines. For example a image structure array allow to build rules for .PSD and .JPG. It is not just for DB's.

Probably more stuff build in a universal format will lather allow much more projects to be imported to othe languages.

Files:

database.h // generic variables
database_mysql.h // calls
database_sql3.h //lite , just for example
database_interface.h // interface in procedural
databes/box_db.h //separation of the database engine to array format.



*I only study db's have to see how to apply to othes.

---------------------------------

Now the files will have the tutorials on top of the file if you want to work on them or learn will be more easy to follow.

How the database_interface.h look : examples for a procedural interface. All related tutorials on what is being done at the moment.

For example if you follow the tutorials they are emolating DOS to have a procedual interface working



The files shoud be in : https://drive.google.com/drive/folders/ ... 7K9ajqU1UT

if you need to contact you can use this email eva.project.dev@gmail.com
jdc
 
Posts: 67
Joined: 29 Jun 2017, 16:48

Who is online

Users browsing this forum: No registered users and 1 guest