Sunday, June 4, 2023

Standard Programming & Variables


"Get to the conclusion that if we adopted standards for things like variables, we can access programs we don't know or have any knwoledge about them. "

That's the main strenght in using standard variables. Instead of inventing a new way to name variables. In a way "we are re-inventing the wheel" or repting our selfs heavily. Which is not good to make all that repetition. Because is a high amount of work that is wasted. 

Now the software evolve a bit from just variables more things are becoming standard. Let's say the way how we do templates. If you have a diferent author a diferent site and diferent framework. Or even some times diferents works they all have a new structure. But lets assume our templates now have a standard way of doing things.

We can also access other people templates just by looking at our templates. That's a high amount of stuff we do not need to memorise which will increase heavely the work flow.


 



 





 

Session 

includes/header_files/session.h

For the links on top we have things that are more sharable. I often put those in the same organization standard/structure. Expect this ones since they share their will be in their own thing to be easy updated. 


char session_name;
char session_tool;
char session_file:
char session_files; 
char session_themes;


session_save()
{

}

session_load()
{

}

The CSS code style



Since the filosofy used is based on structure framework of files. The CSS programing style extends the base filosofy.

A simple example of the base files inherit. Since parts of variables may be used in more then one file instead of being in a file like "DTR" is up one level so that more files inherit. Is a base method used in the software. 

  • Main ->
    • Standard Variables
    • Standard Functions
    • Standard Templates
      • DTR 
      • Interactive Manual
      • Lore


The CSS code style :

Got the ideia when i post the concept at Game Dev forums. People where doing all kind of tips. Then i though also hold be nice if the code do it. Then update it so that now is the basis of also the code style.


We can see in the example once we have: the file extension, error type, and path to files we no longer need to repeat this variables they are inherit. Like CSS code this allow to have highly complex rules width out re-writting to much stuff.


#include "variables.h" 
#include "path.h"
#include "error.h" 


path_folder = "\store_structures\"; 

file_name = "store_structure"; 

file_extension = ".h"

error_name = "unable to open file"; 

build();

file_name = "file_map";
build();

file_name = "variables_map";
build();

file_name = "color";
build();

file_name = "print";
build()

file_name = "type";
build()

For the last example we need another folder so is just a matter to change it. It assume  

path_folder = "\includes\"; 
file_name = "font"; 

build()


Why is this good?

If we ever need to change something in the functions the setting are separated. As the MVC separated logic from presentation. The Separtion of settings from logic may also add a step in your capability to be modular and lather do changes. 


// All files using application structures folder[/code]

Now we see 2 folders included width a CSS rule, store_structures folder and application structure. Error works for both since they are including files.

Can't auto include system libraries since they build auto include, so they are in the main folder, width main.c, they are just included directly. Let's say we are in a diferent operating sistem, that does not use “../” this type. It will work.

Tool - Code editor.

 The connection width Code editor. 

Wanted to created a costume code editor to perform tasks for our own style of programming. (At least will be at the planning for development still seing the best options).

We can see the connection between text editor and code editor. Comments added in text editor, can now be viewed in code editor. They are hovered. Other things can also be hovered or clicked  like : tutorials, code snippets, information, file inherit,  comments, code connected, etc…

Open Links : Something i see is missing from code editor is the ability to open files directly from editor: "open directly : files, functions, variables;…"

Short things width theme : 
lets say we click on a function we can get all stuff connected : files, variables, comments. And display in a new page width all the stuff connected.

The mode debated in previous post to prevent errors: A bottom, “rename”. we click in that button and when we click on a function, it stores the connections so we can rename in safe.

 Display in a menu width all the connections. So it does not make the software slow by waiting for connections of functions. This prevents always displaying connections.  it could bother a bit the work since was always displaying connections this way is by click. In this way we have a button to rename functions, variables or things width connections.

Functions will have a color or a icon to show it have connections, When you want to rename a connected function. Need to click first in the rename mode and then rename : If it was no icons, no need to activate rename button, we can edit directly.
 
ps : width the file map we can also rename all files that have the same variable since it is stored in “file map”, we know which files have that variable. It probably will be delegated to synchronize. From temp data files to temp project files.

The links look :

 Organized the information by topic, so we have less generic stuff. Then the same for :  folders application struture, game and online stuff or related to online.



And the last piece of the puzzle.

A potent search engine to connect all the stuff. We can search just a piece of information, like a ip for a game. Or complex search rules, that can get any information.

This ill help to publicity any thing width out the need to resource to money. This money based search's is very problematic for our needs in today times. We just need to : access the local market, pay; publicity a private game server pay; get publicity for a small application pay…

(in dev interface)

We can separate the information width lists or by : theme,  region, language, author, type, rank, location, by tags of any thing we can connect, etc…

 

 


 

Saturday, June 3, 2023

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


Git Hub : 

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.





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

Patron

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

News



Sorry for the delay on news but think any one can understand the current world events. For a long time i was not able to work on the project now grabbing the design again, and correction some contradictions which i already See in some of the posts.

Forum posts is becoming a big havoc, since we can't delete post, stuff become outdated, admins should check that out...

So the news :

Think i will also published The BOX web PHP which i should have done from the beginning; people where reading posts from the the ting and was not online. We can now read and test it out. Was reading forum game dev posts and see people struggling width PHP so i thought that i should have posted that more earlier it may help some which are starting.

Think i will open repository's on other languages.

Lyberta mention C++ and Rust as better options, they might be. But we can do all kind of versions, no need to keep width only one version, to help people working by them self's. Knowledge take time to acquire. If you have that knowledge for that's nice.

One think, just don't go and make your own repository we all know how will end like Linux : 1000 distro's all working on the same things : environment software, install tools, etc... big wast of work we only need 1 or 2 good tools or distro's.

So we can have like this in Git HUb:

The Box      - C++
"                 - Rust
"                - Python
"                - C
"                . Lua
!                 - PHP (This one is a bit different since it was another project, need to updated in it own purpose.)

Lyberta say he was going to quiet open source, if any one have is contact tell we can start to do it in C++ also. For what i read C++ have the code all properly organized, the down side I mention in other posts, is nested stuff we will not get that much performance as in C. But the bad part of C is require a lot of knowledge, so he kind in a non evolving much situation +-.

[b]If you need any repository in other languages just say, not going to open them in advanced since people may change their mind since things have taken so much time to be updated.[/b]


Now we are going to see the new design:

 I was graduated in Multimedia but my curse didn't mention well on the Design so i was struggling a bit; assumed the information they passed me was correct  or enough. Found  a book and i buy it's on design and explain essential principles which we need to do the design at a minimal level. Do and do it width out many afford. The design Is Now evolving pretty fast, no longer wasting many time in the design details...

Lets say you open a repository for your favorite language and where do you start? (Finished the design on the project.txt mapping file which hopefully be kind of standard for open source projects.)

You can start by create the project tool, to create and edit the file. How does it work? It map all things inside our project, it's like a Make file used in compiling but in here instead is used for the project.

Not covering all; you can see it in the image, but for example : project online is just a matter to edit the file and put it online. Fix a broken div or partition of the interface; if it is register in the file project and some one inside the code delete by mistake it will enforce a left panel for links for example and so on...

Will see lather what can update, is a lot of work as you can imagine...



Standard programming - Master DB

Projects repeat things in the Data Base. For example users is something that is repeated for many aplications since all need to login. A master DB for users remove a lot of redudancy.

- standard programming names ( to add information on how things are done where used, etc...)

- librarys ( to manache the information on compiled librarys on C)

though in adding a master db to our projects this will have the stuff that repeats, you can use it for any project. Will contain :

[b]Master DB[/b]

- Users (general information)
- Bans (kind of bans get)
- apps (application where the user is register)

[b]Your DB[/b]

lets say i'm register in : the box, this forums game dev. just add this to the apps. No point in adding a user management part to all of our dbs.

The files Still very raw is just to keep updating, (maybe chance also the style lather)...

Instead of "doing large posts" adding the information to the files it will be much more organized, and prevent going forward and backward in the posts for the details.

Friday, June 2, 2023

Files, Unit Tests, Macros, Interface


 

- As mention on previous post from now on all things will be on files. Only a few things will be debated and  updates to files will be refereed.

- Unit tests are a new thing and it should be present on any professional code, if you don't have unit tests your code is very limited. The explanation for Unit tests is very simple is a function to call another function to make tests : string_copy() , ut_string_copy(), 2º should call 1º. Is so simple don't know why people don't adopt it. Prefer to search for bugs which will take a lot of time.

- macros The header files are mainly for macros, which as is explained by professionals is not .c it have other type of rules. It resume C code in to a more mathematical form.

- interface found! this very nice code for the interface. is simple and very professional. It will be in the interface.c. It can be used on small projects .

- Since will be adding and working width the files will explain them in here.


Files: (just overview)

Macros.h (many things are macros .h and not .c code. people confound pre processor and C rules)
general_manipulation.c (the code in one library, so we can edit and make improvements to code)
standard_variables.c (separation of variables, it could be in general manipulation but if you don't need any of that functions, is ready to use to another file like in OOP)
str.c (rules for the str files, if you need another is separeted)
db.c (db functions)
css.c (rules for css)
progs_learn.c (prog examples to learn)
definitions.c (separate definitions in to one file to make more manipulation)
ut_general_manipulation.c (unit tests for general manipulation
interface.c (interface parts, width code)
the_box.c (the box functions).

Ps: time limitations prevent to add all things will be just the interface and unit tests.

First Tools and The 1.x Series



For the first version of the 1.x series which is a working series plan to have a couple of tools working; In previous post a 0.x series was just do demonstrate how things where doing it was not working. Since now my knowledge in C grow a bit we are going to have a functional series of 1.x. 

 

We can't start with all tools which is to much work, so planning to have a basic set of tools for the 1.x series. Think will update like : 1.0.x since will be adding stuff to the same series; For the 2.x the plans is to have all the tools in the main software now they will be separated in it's own folder, working independently.

the_box\progs

The amount of tools designs are roughly 100. Some may be lather absorb in to others, others may be extend. It have become a very large project width out founding and partners at the moment.

 

The basic set of tools will be :

 

Links - Mange links in a more robust way, we can access link, and post them online. Share your things widths you can search online but without being spammed width publicity in top 10 sites; information is half by explorers and not professionals and most likely some one abusing your private information. Of the clicks you make.

Tasks - Administrate task, at this stage it does not involve planning.

Notes . Add notes wchih can lather be incorporate in to other tools.

Commands - List of commands to prevent having to writte txt files width them, so they can also be updated by the community (if we can get a server)

Console - Console evolve a bit it now is working width all the stuff posted before, know it was a bit of mess because i was posting and working on the same time. So the information seem a bit diluted. 

Project - The creation and edition of the project width a tool + a file.

Lore - It was announce very earlier is a tool to add the environment aspects to a project

Code Editor  - 

Text Editor - 

File Browser - Didn't though in starting width this tool, but once the code is working maybe is not that hard.

 


 

Standard programming : Files & Folders Structure

Standard programming now includes a lot of stuff. It start just by affecting variables but now have extended to other parts of the project.

 Often the projects have a big mess in the folder & files structure.

One of the things in standard programming is to represent the files in the folders. A folder that contain include files should be named "includes" we can't read it other way :

The Box folder structure->

    Abstract -> a folder to have sub includes files, they often have some kind of data or functionality.
    Includes -> Normal includes people mix them width macros, but many things does not need to be in a header file.
    Headers -> It could be renamed to macros, but for now is just headers. Trudly header files that contain macros mainly. Macros and header files are pre processor you can only gain performance width them.
    Progs -> Standalone option for the main this will easy development. Cause less bugs, to develop things separitly and if need to load less stuff.

   Data -> To store our dinamic data 

   Projects -> Other stuff we do

The structure is becoming very redable...

This way we do not need study the project structure which is time consuming. Lets imagine you have to read 1000 projects on git hub what kind of projects will you prefer to study? A time saving option, width folders representing what it's inside.

Think in putting some files,


The Box Script

Is a alternative to web scripting, see if i will end updating it to programming...

It's 2 or 3 times more modular then the web stuff we have today. Is not actually a script but just rules, we load it to C and he creates the things for us. Is mainly to create a graphic environment.


1 - we can work in any amount of projects in the same file (project=the box)
2 - it does not uses extensions they are declared (image_extension=jpg,png)
3- reuses code parts (line_id)
4- it have security enable checks (security=ask)
5- load text from files in to it (element=10)
6- the end of line is at the begging and not in the end bullets like style ( tbs -> )
7- in theory could support other languages but i don't know if it will happen (css, html, js, php, C# ->)
8- tags stack (id=sub_menu, id=main, level=2, block=list, text_id=text)
9 - it have levels (level=2)
10 - at the bottom you can see other language code how is incredible they are much more complex...
11 - Loading order is organized by order tag "order=1, order=2", to arrange thing for us. (is decimal in case we need to re- organize 1,2 ... 1,7 without the need to change others)

basically one while loop organize the rules and the 2º loop construct it is very simple. Think in putting it to work in just a html server it just need text to work...

while(1) // organize
{
project the box
order =
level =
line_id =
id =
blocks=
text=

project Medivel titans
order =
level =
line_id =
...

Project Eva project
order =
level =
line_id =
...

}

while(1) // assemble
{
the box
load images
load windows
load text
load models
load templates
load modules
...
}

What is happening in the examples:

- we are reusing a login/register throw 3 projects, the_box,eva project, medivel titansl.
- we doing auto querys to the db
- We have web script width real time security
- Call on effects functions
- we have losse programming if you want to add something at the begging to the box project, and lather call the other two projects, you can re assign the box project again in a 2º time and continue to do things.
- we don't have large amount of text in the file is coming from other files throw element= tag, we can have titles, sub titles names, etc... any text... but if not needed is not inside. Make the file really small.
- define in the script amount of pages or item per page
- tags for other languages : C#->, PHP -> normal or composed, C#, PHP, TBS -> a line that support multi programming languages, (could generate more errors)

*some things still need more work like how templates, modules inter act and programing at this stage did only most web things.

The rest you can see for your self...

Ex:

tbs -> project=the box
tbs -> current_page=boot
tbs -> version=1.x
tbs -> img=logo order=1
tbs -> project_folder = applications/pages/the box
tbs -> assoc_keys=
tbs -> file_link=articles
tbs -> image_folder=
tbs -> icon_folder=
tbs -> image_extension=jpg,png
tbs -> torrent=8A5148D6306606F5250F8E14AC7657FC9012A520
tbs -> tile=the box
tbs -> id=main, items_pages=10
tbs -> autor = jdc
tbs -> email = eva.project.dev@gmail.com plex
tbs -> link = https://thebox0.blogspot.com/?zx=8aeda2665c691d35
tbs -> db=users, db=articles, db_query=all store=db_articles
tbs -> link_file=icons store=icons elements=all
tbs -> allow_commads(), effects
tbs -> id=all, space: m 10, p 20, text_translate(),
tbs -> id=main, type=box, level=1, text_id=text1
tbs -> id=sub_menu, id=main, level=2, block=list, text_id=text
tbs -> id=right_menu, id=main, level=2, block=list, text_id=text
tbs -> id=links
tbs -> id=effect_hover, block=effect, level=3, script=hover_effect
tbs -> id=sub_menu, text_replace(), text_translate(),
tbs -> id=login_menu, user_login(), user_register()
tbs -> page=login, page=register, page=main, level=2
tbs -> page=boot, level=1
tbs -> open_file(), security=ask
tbs -> array security=
tbs -> url= redirect=no security=1
tbs -> text= the box , order=1, text= software development tool order=2
tbs -> id=main text= web site dedicated to make posts on the software
tbs -> line_id=1 list=Link1, Link2, Link3

tbs -> file_link=articles element=10

tbs -> order=5 display=list title= Downloads, Media Fire text =

Preferring "Media fire" over other projects, like Github you have to upload file 1 by 1 which is very pre history for computares and software capability today. Another issue you can't have empty folders or move large amount of files in your project, you have to move them 1 by one. Can't delete folders, you have to remove files for it to disappear. And you guessing how you remove files for it to disappear? Maybe you guesses correctly again you have to remove files 1 by 1. Insane work! It is not possible to administrate a large project like this moving files 1 by 1. There is a lot of editing to be done.

Why not use the tool for the page? They maybe attempt to attack again : why use this wired tool when you have FTP's services for like dozens of years. In computeres that's a lot. Like from the 1920's or so we have FTPS services.


tbs -> line_id=1

tbs -> order=5 display=list title= Downloads, Media Fire file_link=articles element=2

img=project_tool

tbs -> project = tides of time

tbs -> title=tides of time

tbs -> button= login, register

tbs -> password, re-password, user name, translation=all

tbs -> icons=gold,food,

tbs -> links= Characters, Attack, exception= on page-tides of time remove=characters, attack

tbs -> clock=4m

tbs -> project=medivel titans

-> line_id=1 (links)

tbs -> project=eva project

-> line_id=1 (links)

-> structure= math lib
-> structure= standard variables

-> module= player

-> module= map

-> script = attack if=range<200

-> template=a1

-> JS-> snyppet = javascript

-> map=level1

->graphics=opengl 2.0


php, C#, Css, HTML, Js ->


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

css -> p {margin-top: 100px; margin-bottom: 100px;}
html -> <div id="main"><ul><li> a </li><li> b </li><li> c </li><li> d </li></ul></div>
js -> let x = "Volvo" + 16 + 4;
php -> echo strlen("Hello world!");
C# -> using System;

namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
Java ->

public static void main(String[] args) {
Main myObj = new Main(); // Create an object of class Main (This will call the constructor)
System.out.println(myObj.x); // Print the value of x
}


$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});

New Programming Language


Linked vs Math Languages


Doing a bit of research on how to build a programming language to fit this new style, and to put things to work like the layer, a method debated a few posts before. Which inside the programming language is not that easy to make. Some things are better to develop on a new programming language.


One think that i was looking at programming languages and notice they are heavyly matematical. If you don't like math, well you are in trouble. But since programming does not need to be mathematical since it is related to though can be linked.


This is the progress that i made. We simple just not declare variables but also all there propertys, a bit like OOP but just in variables. We use diferente simbols to instanciante and declare. Because it may contain functionality. 


The code will drecrease like "30" lines to just 3?


Function - operatores, and funcionality

Relations - how is related, to declare arrays and list

Connections - declaring scoops, like put a variable inside a function width out putting it there manualy.


ª declare

& call

º override


* this = is updated to just - . The other one is a operator, which is a bit ilogical to be in the code declarations.  


Index for declaring variables :


Simbol, name,  type , size, error , function, relations, connections




[code]


Declare


ª, array_names , array , 255 , "array_name invalid", array_add(), "" , "";

ª, counter , int , bool , "counter invalid", ++; max 100 , "" , "";

ª, LOOP, function,

ª, repeat, int , bool , "counter invalid", repeat , "" , "";

ªarray_names - "lyberta", "scamerson", "dread knight", "ninja".


Logic


%repeat,

&counter,

&print,


[/code]

The Structure - Build & Deconstruct



The structure will work as a operating system. Will add stuff in to the structure and remove it . 

We will have 2 methods,Build (named to not repeat any stuff) and Deconstruct. 

In the example we are going to see a simple method to build a math.h library in to the install list, and a over view of the installed things. also the deconstruct to uninstall the library. This is under develop things may change but think you get the point how we can do all this stuff width just command width out using any graphical environment.


The possibility's to the Build & Deconstruct methods and very large. In here i'm just touching the surface.


My seem a bit redundant but maybe you are not seeing the possibility's. Less people programming, accessing others build methods, find faster the dependency's and errors, manipulate the project without touching the code, etc...


[code]


int build_math_lib ()

{

structure_includes_amount++;

structure_abbreviation = "LIB";

structure_name = "math";

structure_includes = "#include <math.h>";

  structure_dependency's = {"exp", "double tanh"...};

structure_files = {"simulator", "RTS"};

return 1;

}


int deconstruct_math_lib()

{

structure_includes_amount--;

structure_name = "math.h build in";

structure_includes = "#include <math.h>";

structure_dependency's = {"exp", "double tanh"};

structure_files = {"simulator", "RTS"};


        return 1;

}


[/code]


Structure over view : 


Example of a structure list

Structure

name : The Box

includes : 100

files : 500

functions : 300

variables : 1000

dependency's : 2000

Installed :

lib math (battle_simulator, main, calculator)

lib string ()

lib limiths

lib stdio

lib stdlib

lib time 

lib standard_variables

lib standard_variables_game

lib standard_functions

lib standard_functions_game

script player_move

window 3D enviorment

sound wave

sound ogg

img JPG Compress

img JPG 

img PNG

OS Linux bindings

OS Windows bindings

OS  bindings  

DB mysql

DB mongo

DB Script


I wanted to do a DataBase master for users which i mention on a post before. to avoid including again the users. Now i came up width a design for it. The result seems pretty surprising. If it works will be the highest level achieved in programming languages. Your program will become completly modular, you can updated to any thing you want.


It mixes: procedural, objects, db's, data, programing, interface. script, graphics, administractiom, All things in the same file. So in the same file we have the prototypes and the declaration or instances. The prototype is the "Master DB" a diferent format and in the others we have the information. You can update your databse in real time, convert the project to online width a few clicks, and the possibilitys for the program to evolve are unlimited.


It's hard to explain it in pratice because you can improve it to any thing. Now it have this state, but lather can be much better relational. But these is enought to discribe. We have 3 parts: operators logic for the master DB ;  Master the prototypes, and 3º Instances. Think is the best design of those i'm doing.


It avoid a lot of problems, like fails in the db, not be able to desin when coding, program become to heavy in a earlier stage, coding to much while just desiginig, and so on, etc... The design can achive all parts that you need and the sintax is very simple.


example : a Ultima Online skill, named "status" it as a name and a max value of 100 in a decimal format and a Operator :  Status : name, float value (max=100)


DB script :


Operators


max - a int or float value can't go above max


DB Master


User : "user_id", "user_name", "user_password", user_email, validate_account, 

Abilitys : name, min_effect, max_effect, effect

weapon :  name, min_damage, max_damage, ability

Armor : name , armor, type

Building : name, armor,

Vehicle : name, armor, damage, ability

Character : profession, speed, ability

Tool : name, language,  function

Equipment : name, min_effect, max_effect,

Status : name, float value (max=100.0)


DB The Box


Tool : standard variables, C, hieraquy 

Tool : search engine, C, main

Tool : search engine, C, main


DB Medivel Titans


weapon :  long sword, 8, 14

weapon :  Axe, 1, 24

weapon : wand, 1, 8, healing

ability : wand healing, 1, 8, + health

Vehicle : wagon, 100 , 1-10,

building : tower, 400, 0, 



DB Eva Project


Character : gazer, 0 , 

ability : wand healing, 1, 8, + health

Building :

Vehicle :


DB Ultima Online


status : strenght, 1 

status : bard, 0.0 

status : swordmanship, 0.0 

status : axe, 50.0 

status : alchemy, 0.0

Added this object : file_map.h



it connects stuff for us inside the software

To Implemented auto generation of projects

 Connected and linked files inside our project could be used in the mappper tool (in development). A more advanced connections or all connections in one place. In here it is used for development. We don't need knowledge on "framework" it kind know that for us.

Another placed is used is in the tutorial tool . For example we could know what files are using this tutorial. It connect a tutorial to files that are using that kind of theme.

Auto generation of projects also used : so we know what we need to include, and what kind of functionalitys, If we create a simple program that needs : a interface, text, math, operating system. The software knows what that files are and do to include and connect to mount the software.

[code]
file_map.h

char file_name;
int file_hierarchy;    // order of include;
char file_functions[];     // functions it uses
char file_functionality; // what it does
char file_dependency's; // what it inherit
char file_theme; // the theme of the file or object "colors"
char file_operating_system;
char file_description;
char file_tutorials;
char file_types; // what kind of data it handles, jpg, models, etc...
char file_structure // where is loaded from or group of files, example : application structure
char file_description  // loads the description from the file.  

[/code]

The other part is to store. We store stuff in the .txt files so we could also map a library used in C. External library, or a piece of code, from some kind of framework. It probably need also to link external files. If the framework is installed. We also could add parts of external code to our program.

Style of the files

Style of the files

 This usely should be in a file for which part. Bit like C was design in the first place, like having one library for which theam. Strings will be in <strings.h>. In here if we are going to use the project it should be in <project.h>.  


includes/header_files/project.h

includes/progs/project.c  

Tool : Debug

 As the features in C are so complex I will write a Debug tool for each theme. The software will have a "Folder" or additional folder called "Debug tools", where they will be there. It makes various tests for example the images: it loads the image tests and outputs the image and all the image functions information; Maybe check for errors, see if the image is at 100%. This will help develop the software, and perform various tests. With this tool you can develop only the part of the images and connect later later, without all the code working.

Also found this software which have a interface working is very nice to study code. Since have information we can't find in the toturials.

https://sites.google.com/a/liesenberg.biz/cjogos/home/software/interfaces-graficas-em-c
http://www.enchantia.com/software/graphapp/

 

[b]The Box Version 0.0.2[/b]

Still it does not have that much work that i wanted but is the possible work. The file have like 30 pages. It should have every thing you need to understand and develop. It explain: interfaces, code, objects, objectives, tools, tutorials, planning, etc…

2 PDF, and the box folder :

You should have access to the public folder

https://drive.google.com/drive/u/1/folders/1LqXNvuu5p5t7cQ4yH-7YEqugL7glslMk

 

[b]Update[/b]

Missed a small thing, how to convert code to procedural to use with the global objects.

Think the theory of structural programming could also be called stack programming, or have a stack part in it, because we do things by stacks.

In this example we are going to see a stack.

In this function from Lips of Luna, nodes for 3D models. How to covert it to procedural code:

[code]
LIMdlModel* limdl_model_new_copy (

const LIMdlModel* model,int shape_keys)
{
 
int i;
LIMdlModel* self;


self = lisys_calloc (1, sizeof (LIMdlModel));
if (self == NULL)
 return NULL;
self->flags = model->flags;
self->bounds = model->bounds;

if (model->hairs.count)
{
 self->hairs.array = lisys_calloc (model->hairs.count, sizeof (LIMdlHairs));
 self->hairs.count = model->hairs.count;
 for (i = 0 ; i < model->hairs.count ; i++)
  limdl_hairs_init_copy (self->hairs.array + i, model->hairs.array + i);
}

if (model->lod.count)
{
    self->lod.array = lisys_calloc (model->lod.count, sizeof (LIMdlLod));
    self->lod.count = model->lod.count;
    for (i = 0 ; i < model->lod.count ; i++)
        limdl_lod_init_copy (self->lod.array + i, model->lod.array + i);
}
if (model->materials.count)
{
    self->materials.array = lisys_calloc (model->materials.count, sizeof (LIMdlMaterial));
    self->materials.count = model->materials.count;
    for (i = 0 ; i < model->materials.count ; i++)
        limdl_material_init_copy (self->materials.array + i, model->materials.array + i);
}
if (model->nodes.count)
{
    self->nodes.array = lisys_calloc (model->nodes.count, sizeof (LIMdlNode*));
    self->nodes.count = model->nodes.count;
    for (i = 0 ; i < model->nodes.count ; i++)
        self->nodes.array[i] = limdl_node_copy (model->nodes.array[i], 1);
}[/code]

The node.c file which will be kind of a stack if it works in C, didn't test it. This how i do it in PHP.

[code]#include model.h / global variables on models
#include draw.h

models = “model1, model2, model3” // models to load

#include node.c

----------Start  node.c----------------

while (models != not empty)
{
    for (i = 0 ; i < model->materials.count ; i++)
{
            limdl_material_init_copy (self->materials.array + i, model->materials.array + i);
    }

    for (i = 0 ; i < model->nodes.count ; i++)
            self->nodes.array[i] = limdl_node_copy (model->nodes.array[i], 1);
    }

}
---------end file----------

models_array // loaded models

#include draw.c // draw the models
[/code]

the global variable should have the models loaded after the include of the file. The file is only procedural code. and is very fast. and very easy to read. 


[b]Tutorial on code design and how the code is looking like :[/b]

[u]Code refactor on Lips of Luna[/u]

The refactor of code does not seem that hard once we have the planning, was able to refactor high amount of code. Doing like this: first remove all dependency and leave only procedural code, “leave notes in case we want to know what is going on lather” do not remove libraries because on 2º stage we are going to need to get that extra code from the dependency's.

[u]Object planning[/u]

Object planning this is already on the internet i din't invent it, the theory : “if a object is doing to much is bad and is if bad doing to little. So a object should deal with a set of functions in a proper way". For example Lips 3D model load first file is ok in therms of planning but the 2º part i called in this example : ”open model" and “load of model”, in this case is load of model, there are several files scattered with 50 lines  which, in this case is doing to little.

I will convert them in to the “load model”, to deal with materials, particles, etc…

[u]Code [/u]

Is more advanced then my PHP engine, it was only one layer, or two layers. In here we have several layers, and inheritance.

I usely put all variables on top to be more readable, but in here since we may reuse variables, putting them above the include, for now putting the settings in if and else, if need some kind of setting from file is just a matter of setting to true. “files_list = 1; // true”

to refactor functions : it transform them in a if with a true state, to use e need to set it to true.

But still have to see what will be the better design.

[u]Dynamic functions[/u]

For now setting all to file object non dynamic, lather when it evolves if procedural can't handle it i will create a “system object” to pass things to procedural or handle the parts procedural can't.

A bit like PHP : it uses procedural based on a Object, or a set of objects.

[u]How the code looks:[/u]
 

[code]#include variables.h
#mouse.h
#keys.h

language = "PT";
#include language.c

operating_system = "windows";
#include settings.c

mouse_arrow = "costume arrow";
#include mouse.c

keyboard_esq = "jump";
#include keys.c

//Concatenate

#include path.c //Open directorys

folders = {"", "c:/the_box/projects/models", "c:/the_box/projects/images"};
folders_index = {"models", "images"};
files_list = 1; // true
directory_list = 1; // true

#include open_folders.c // open folder

images = {"image1.jpg", "image2.jpg"};
images_index = {"menu_button", "menu_effect"};
#include jpg.c

models = {"model1.3D", "model2.3D"};
models_index = {"character", "character2"};
#include open_models.c // models open

3D_low_poly;

#include load_models.c

window_height = 400;
window_width = 400;

#include window.c

control_height = 400;
control_width = 400;

#include control.c

text_style = "liberation serif";
text_color = "black";

property_background = "white";
property_menu;

property_buttons = {"button1", "button2", "button3"};

property_button;

#include interface.c

draw_menu;
draw_map;
draw_models;

#include draw.c[/code]

DTR Database text reader



For now there is this stuff i'm working. A text format to manage projects. The text format, xml and jason are a bit heavy, creating something that is similar but in a more light version.

A way that this could work :

"link of the file", "place used" (main menu), order of display (1).
C:\Users\jdc\Documents\the_box_external_librarys\magic.png , main menu  , 1 ;

It could be a transitory way before the file is added in to the code files in a function format or it could work this way, if it does not consume a lot of resources since one of the objectives of the project is to have a very efficient code.

A general overview of a project in the : text projects code :

[code]

</1>

<title>

Mediev Titans

<description>

A DOTA inspired game, strategy

<3d models>

C:\Users\jdc\Documents\the_box_external_librarys\3D_medivel\Goblin\Goblin_model\GOBLIN.fbx  , level 1  , 1 ;

<images>

C:\Users\jdc\Documents\the_box_external_librarys\magic.png , main menu  , 1 ;
C:\Users\jdc\Documents\the_box_external_librarys\final.png , level 1  , 4 ;

<levels>

Main Menu ;
Level 1 ;

[/code]

The dev version is online it have a lot of updates, working with file.h and path.h to manage stuff for file "browser tool" and "code editor tool". The stuff i posted before is now used, we will repeat the code in file.h and path.h in : browser tool and code editor since they use the same things. To prevent this, the code is moved a level in the hierarchy to a "object" or structural programming format. So they inherit.

This format is useful to code,  It allow to write allot of pseudo code before we can start testing things. Because you can start codding normally, and if something repeats at some point is just a matter of moving the code up and down if is repeated or not.

The stuff in the folders is still a bit messy and not documented, it still need more work, the external library have a low poly 3D library that i'm working. Just one thing that is +- organized.

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

https://drive.google.com/open?id=1D4Vi9dwreux0TX8-iQuYTJkv1HrnUH5x  External librarys

https://drive.google.com/open?id=1JndNxwLra9uMxhQ_PlF_UZjYF4nnt2di External Project

https://drive.google.com/open?id=1ZPZdAr6--7oiWyNv7_9Z67b7kErTkgGD External tools

 

a small update:

How to to add large amount of information to txt files.

In previous update, i have something that look like a xml, but now i'm thinking there is no need for the user to read the files, the software can do that, and display the information formatted. It allow more amount of information in a file.

Which project or data is just a single line.

The software read like this and apply this format : name, author, genre, type, image, web page, etc... it uses order or numbers for position on which entry.

The txt file have only the information. The software recognizes positions. If there is no info in entry slot a empty field is added, like ", ," :

[code]lensman , autor , anime , sci-fi , 0.3 , lensman.jpg, https://www.youtube.com/watch?v=RpmTynxXGCM ;
Hunter D , autor,  , 4.5 , hunter_d.jpg,  ;
Eva  , autor , game , sci-fi ,  , eva.jpg, ;
Pokemon , autor , anime ,  , 0.3, tides_of_time.jpg, ;[/code]

This will be very fast execution. the code do this: It "explode" the strings by tokens first ";" an then by "," to get positions, and convert to data format to display.
 
Maybe it will use symbols instead of the language symbols ";" and "," to be compatible with descriptions on projects. but it will be the same thing.

Graphical Code


 External projects librarys will be inside the external includes : the_box\external_includes


To install you need to run the make file, only then you can compile it width the Gcc compiler  width the compiling flags for the library if it have some. In linux that is simple think it comes as they call it "out of the box" in windows you need the make a software to use make. I didn't use it but read this software may do that

https://chocolatey.org/install

 

Code for a menu

https://stackoverflow.com/questions/39025074/c-program-how-to-print-in-table-format-alignment

Ncurses

https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/index.html

https://invisible-island.net/ncurses/announce.html#h2-overview

Graphapp

http://www.enchantia.com/software/graphapp/

Another Graphics 

https://www.codeproject.com/articles/363908/simple-two-file-graphics-library-for-c-cplusplus


How to display info in a table format to console just with raw code.

[attachment=0]7uLn0.jpg[/attachment]

A bit on my develop of the software, how complex the lore tool is becoming.

For example we can add all kind of lore stuff in to a files "database" format. Then it connect all this stuff to the design document. When your are building the document you can link stuff at that point from : -> projects to design document; from -> lore to design document, and to templates.

So let's say some one add a nice environment like a history with a few cities and a few characters to the "box lore tool".  if you want your game to follow up on that history you just need to connect that "lore" to the design document or project and use the same librarys/templates and is done.

Think it will be also good for standardization of history's, for example the concept of race orc, can become more elaborated and standardized adding good environment to games. Or people could also go with their own stuff. But if you do not have that kind of skills to create this very nice story. You can set your environment on something already stable.

Another think i though in adding is a "project finance" tool like kickstarter , why pay 5% or 10% when you can add this stuff automatically in to a server and let people make their own decisions. Once you create your project you can automatically config what kind of finance could help your project.

How the  links code look inside of the lore tool : Add stuff seperatilly with more detail or add with generic menu with all the options. If some already is scripted this functionality it add it automatically with "standard functions tool" to maybe the mapper which is the generic overview off all the relations/connections:

[code]    printf(" Game Lore Menu : pick option \n\n");


    printf("1. Exit tool\n");
    printf("2. List Lore  \n");
    printf("3. Add Lore  \n");
    printf("3. Add Design Document  \n");
    printf("3. Name Generator  \n");
    printf("3. Create character  \n");
    
    printf("10. Game lore : Add Religion \n");
    printf("10. Game lore : Add Races \n");
    printf("10. Game lore : Add Spells \n");
    printf("10. Game lore : Add Items  \n");
    printf("10. Game lore : Add Skills  \n");
    printf("10. Game lore : Add weapons \n");
    printf("10. Game lore : Add armor \n");
    printf("10. Game lore : Add Classes \n");
    printf("10. Game lore : Add History \n");
    printf("10. Game lore : Add Geography \n");
    printf("10. Game lore : Add Maps \n");
    printf("10. Game lore : Add Families \n");
    printf("10. Game lore : Add Guilds \n");
    printf("10. Game lore : Add Worlds \n");
    printf("10. Game lore : Add Citys \n");
    printf("10. Game lore : Add Monster RPG  \n");
    printf("10. Game lore : Add Monster SCI-FI  \n");
    printf("10. Game lore : add NPC  \n");
 [/code] 



Stand alone progs

[b]Git Hub[/b]
[b]Standalone[/b]
[b]pointer variable[/b]
[b]main tests[/b]
[b]variable names[/b]
[b]learn[/b]


- Adding updates to git hub, organizing is a bit confusing. (the code update from the books is still on working...)
https://github.com/saintsoftware/the-box

- all programs will be in a stand alone format, so its easy to to work on them it out affecting all other programs.  Now we can start using them as soon as some code is in there.
 ---- standalone/links.c ; etc...

- A update on the pointer definition
[code]type define * ptr.[/code]
 The pointer abbreviation already exist is [u]ptr[/u], defining pointers as a asterisk : " * " ; look a bit weird. and most if not all languages have adopted the "int" "char" 3 letter abbreviations for variables types.

[code]int ptr integer1
char ptr character1[/code]

on --- includes/macros.h

- separating main for tests and for code.
main_ut, main, main_help_info. (maybe only 1 main for tests will see lather)

- adding a bit updates also do function names.
 maybe adopting C abbreviations for them. (will see how it goes)

[code]f_count_chars();
f_count_lines();[/code]

f -> file
c -> character
i -> integer

etc...

used in C as "uint" -> unsigned int

- Also adding a learn folder
A folder width all the examples we can find or are relevant to work and develop width C.
some stuff is in Portuguese if have any problems use google translate.

Structures


 

[b]The main[/b]

main()
{

if(zone == liberta city)
#include shop_obj;
}
else if(zone == main menu){
#include main_menu
}

You don't need any thing... is just modules width no dependency's... Easy thing you will ever find.

 

[b]Advantages:[/b]

you do not need to write your Database, if you don't want to; you can just alter global variables for shop, You don't need to write a save if you don't want, etc... all functionality in the same variables and modular...

all the functionality possible already written:

-camera
-character movement
-attack
-AI
etc...

You can still have your variables, in the objects, you just need to know the standard.

class character
{
name;
age;
race;
etc...

character_the_box() //on init object
{
name = character_name;
age = character_age;
}

when you initiate it loads game variables...


[b]Missing another thing.[/b]

How to configure your project.

'Build a costume array index's, width the same names as global, and the Box will know what you are using.

The Text RPG i'm using. Will be something like this:

char character_index_array = {
"character_id",
"character_name",
"character_race",
"character_age",
"character_languages",
};

id for database store. Some things you need knowledge but is as i write or on files, or on posts. You don't need to learn a new framework.  

So that the game can load character, and database can save, or files.

[b]Never Shaw?[/b]

100% procedural engine. Think people stop developing procedural engines, that may be the biggest reason.

 [b]C++ is faster?[/b]

You can't go below objects because is based on them. They consume a lot of resources. In C you can add assembly which will be very specific i doub this articles, based on limited tests. On all the internet say procedural is fast. The logic is against C++. How something that use and load more information can be faster?

Frameworks faster? Even professional console e-game players say the games are slow that will affect their  performance. Is not faster, it can code faster because you have more things arranged.

I think is a matter, of standards, and costume games width modules, not large paid frameworks.

But will see is still evolving. My PHP engine as much more limited it only use principles of what i'm doing width this engine, improving a bit more the concept.

Questions and comments help a lot because most of the time we are centered in design and development don't have time for this questions or reflections, so when i See them ya "that is a good point" Made a lot of updates width questions/comments on game dev.

* PS: most C functions where not build for performance, they load many not needed stuff. But if you refactor them, and they load only the needed thing, "if i where you will not bet my money on C++".

A detail

You can use your logic to make all things you want, when you are finished.

character->save
shop->save
item->save

And you save all things back to globals, and will give zero errors. No need to use structure variables if is not needed or don't want in the objects.

Why the style



Ya adopted this style because i having memory problems and when i get to the code i could not read it. Not that i have problems in reading functions. Another thing, lather it was much more easy to read and maintain.

Move from functions to more of CSS "html cascade style sheets" style of code. And most people prefer this style of code, because is easy to program, width out making many thinking.

to writte like 100k of CSS code and maintain CSS is much more easy.

They don't like it? In the end is a bit hard for other people to help out because or the project is not mature enough they don't understand objectives, or the design is still improving.

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

[b]News[/b]

Thanks for keeping me motivated, think i will lunch this time 0.1.x version which will be a big thing, from 0.0.x. Finished all the things i wanted. Have C algorithsm working. Think most of the basic stuff will be working in next version. [b]Will be a working version[/b]

And i was about to give up the project, if was not for people comments and support.

Adding assembly to refactor some of C heavy functions like: printf, draw or loops. Not for all things, but like why use printf generic for all things when we could have print_int, which will consume much more less resources. Specific just for integers.

Liberta thinking in adding C++ for heavy libraries which i'm not thinking in re-writing now, (more on a long therm) since C communicate width every thing, you can even add assembly directly to code, if you want to program some raw graphics to add, if they have all the dependency's. I can add the files to the project.

Costume stuff in directx and opengl will be nice. Maybe add a folder for C++ stuff.

Personal tastes & Unit Tests


Personal tastes

All come down to personal preferences, we can't control all things. This style works, it have it's positive and negative. Other styles will have the same. C++ is probably great, still is the same it have positive and negative. If something works and you can create large code or a engine on it you can't say it failed is just a matter of personal style.

If any day you thingking in adding code to the box will be pretty easy you just need to see standard global variables , that are in the "header_files" folder, now i thing it is called rpg.h made a couple of mistakes in this version it should be called game_structure.h or standard variables in the future, and add them to objects. If your code alter the state of the variables, other code can still be added.

global variable.
object c++
procedural code

For example one aspect of C++ you will not get that much performance as C procedural, C procedural will not do much as C++ to start width (code). Etc...

https://stackoverflow.com/questions/199 ... -in-c-code


Liberta one time you mention structural programming already exist, but is not the same thing. This method derive from studying MVC it works the same way; the main, will load stuff in to it. Is more "Pattern programming" or "Pattern structural programming" probably more accurate.
-------------------------------

Unit Tests

Some one at discord "The code Den", say to implement unit tests. I was reading about, is the same as the Box or structural programming is not a framework, as i though in begging "why implement a framework to test code which will require X hundred of hours to learn it will not be very productive". But i as reading is just a method like the box not a framework; It can be a framework but to start is a method.

If you want to study methodology https://en.wikipedia.org/wiki/Unit_testing you have here the unity tests, it is the same as the box, don't know if i need it because once we start repeating code, it will always the same we no longer add or learn new stuff. I code for hundreds of hours width out any errors, another method for errors probably to much.

"I will see how it goes..."

Procedural true performance

Procedural true performance

 
One of the benefits of this engine is the procedural speed people where asking or saying is not faster. But you can check your self How 2 loops not nested are faster the 1 nested loop.  

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

Added to git hub don't like that much, all things done by hand, like move files by command, and only 1 which time. All tasks kind of manual. Only upload 100 file which time. No empty files. The program is suppose to fill those files they are not there just to take space. If they take any at all.

https://github.com/saintsoftware/the-box

Added the documentation folder.

This will help for people to learn in the project. For example, instead of reading a wikipédia article on JPG, we can get those articles and mount something more elaborated. Like width code examples. OR things connected width the project. In next update already have many stuff on BMP. If you need to learn BMP for raw applications or engines, you will have there a well planned documentations.

Folders for this:

->Documentation

   ->BMP
      -article1
      -article2
     ->JPG
    ->3D theory
...



hi

How fast we develop in Python

  Develop the base for the prog all this stuff is linked and working in a couple of days and I was learning. Things always come up, but for ...