Asking about what has / what will happen to the software renderer?

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Noiecity
Posts: 314
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Asking about what has / what will happen to the software renderer?

Post by Noiecity »

Well, good that it's working for you, it's good to work that way.
I mean that a .txt takes much longer to read, a .bin is very fast to read, these are practical when it comes to building a database...

An example:

Code: Select all

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_NAME_LENGTH 50
#define MAX_CHARACTERS 6
#define MAX_ITEMS 100
#define MAX_DROPS 10
#define MAX_MAPS 32

typedef struct {
    int id;
    char name[MAX_NAME_LENGTH];
    int type; // 1: Weapon, 2: Armor, 3: Potion
    int value;
    int weight;
} Item;

typedef struct {
    int id;
    char name[MAX_NAME_LENGTH];
    int experience;
    int health;
    int attack;
    int mapId;
    int x;
    int y;
    int inventorySpace;
    int level;
    int inventorySize;
    Item inventory[MAX_ITEMS];
} Character;

typedef struct {
    int id;
    char name[MAX_NAME_LENGTH];
    int level;
    int health;
    int attack;
    int experienceReward;
    int mapId;
    int x;
    int y;
    int dropCount;
    struct {
        Item item;
        int dropRate;
    } drops[MAX_DROPS];
} Monster;

typedef struct {
    int id;
    char name[MAX_NAME_LENGTH];
    int difficulty;
    int x;
    int y;
} Map;

typedef struct {
    char username[MAX_NAME_LENGTH];
    char password[MAX_NAME_LENGTH];
    int characterCount;
    Character characters[MAX_CHARACTERS];
} User;

void writeUser(const User* user) {
    FILE* file = fopen("save.bin", "ab");
    if (!file) {
        printf("Error opening binary file.\n");
        exit(1);
    }
    fwrite(user, sizeof(User), 1, file);
    fclose(file);
}

void readUsers() {
    FILE* file = fopen("save.bin", "rb");
    if (!file) {
        printf("No saved data found.\n");
        return;
    }
    User user;
    while (fread(&user, sizeof(User), 1, file)) {
        printf("Username: %s\n", user.username);
        printf("Character Count: %d\n", user.characterCount);
        for (int i = 0; i < user.characterCount; i++) {
            printf("  Character %d: %s, Level: %d\n", i + 1, user.characters[i].name, user.characters[i].level);
        }
    }
    fclose(file);
}

void createBinaryFile() {
    FILE* file = fopen("save.bin", "wb");
    if (!file) {
        printf("Error creating binary file.\n");
        exit(1);
    }
    fclose(file);
}

int main() {
    createBinaryFile();
    User user = {"player1", "password123", 1};
    user.characters[0] = (Character){1, "Hero", 500, 100, 20, 1, 10, 10, 10, 5, 0, {}};
    writeUser(&user);
    
    printf("Data written to save.bin successfully.\n");
    printf("Reading saved users:\n");
    readUsers();
    system("PAUSE");
    return 0;
}
Image

:mrgreen: :mrgreen:
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
Brainsaw
Posts: 1239
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Re: Asking about what has / what will happen to the software renderer?

Post by Brainsaw »

Yes, it takes longer to decode text, but there are some other problems you can avoid this way (endianness for example). In MarbleGP the network messages are all text messages, numbers are encoded with base 64 (not base64 encoded :wink:). It works without problems, especially for network games with Windows PCs and Android phones. For encoding and decoding I use C++ code generated by Python from JSON encoded message definitions
Image
Dustbin::Games on the web: https://www.dustbin-online.de/
wizard4
Posts: 181
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Asking about what has / what will happen to the software renderer?

Post by wizard4 »

I'd love to learn Java for Android and JavaScript for networking. I think those two are the only ones I'm after judging by Brainsaw's game. I did want my own server running with a game client and might as well throw in mobile.

I am a happy subscriber to PlayStation 4 Premium so I get PS1 and PS2 classic games. These are they only games I want to play, apart from Poker. I took a photo of Primal to show you and the graphics are great and it's simply exciting.

Image
Noiecity
Posts: 314
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Asking about what has / what will happen to the software renderer?

Post by Noiecity »

wizard4 wrote: Tue Feb 04, 2025 7:26 pm I'd love to learn Java for Android and JavaScript for networking. I think those two are the only ones I'm after judging by Brainsaw's game. I did want my own server running with a game client and might as well throw in mobile.

I am a happy subscriber to PlayStation 4 Premium so I get PS1 and PS2 classic games. These are they only games I want to play, apart from Poker. I took a photo of Primal to show you and the graphics are great and it's simply exciting.

Image
I would like to make a ps2 based on irrlicht, and another ps2 based only on precomputed graphics(in the lowest level language possible), using 25 dollar banana pi m1, mmm.... cheap console, it would only be about making good games...

I'm already finishing my friend's app, I just need to copy and paste some sentences in some buttons and add multiple languages... once I finish that you'll see me more often around here uploading animated models and scenes for irrlicht...

So for now I'm an outsider stealing your time... :mrgreen: :mrgreen:
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
wizard4
Posts: 181
Joined: Thu Jan 25, 2024 6:54 pm
Location: UK

Re: Asking about what has / what will happen to the software renderer?

Post by wizard4 »

In the making of my first three games I did run into issues with menu UIs and game states. I used an enumerator which did help, but was stuck switching between pause, play, restart etc.. I tried searching for a library and found this libsdl2gui but the problem was my phone app couldn't work with it. It's a reason I chose H-Craft as a learning curve to see how a bigger game handles so much stuff. Sorry for the switch over during a **** time :roll:

I did look into the Irrlicht API to try and see any way of controlling SOFTWARE stuff, but it's buried in the source folder and I don't want to copy paste the 3D Guru book's clipping code as I doubt CuteAlien would patch the software side anyway. So my journey ended with controlling software in Irrlicht. I did use one technique which broke the polys down (keep using divide mesh until the triangles are so small you won't notice much difference on the edge of the screen).

Also I went to a guitar group recently and the guy there is helping me learn things. He can tell me advice but I don't have to listen. If I stop being so dramatic I see he gives good advice so I'm sticking to the group.
Noiecity
Posts: 314
Joined: Wed Aug 23, 2023 7:22 pm
Contact:

Re: Asking about what has / what will happen to the software renderer?

Post by Noiecity »

wizard4 wrote: Tue Feb 11, 2025 4:04 pm In the making of my first three games I did run into issues with menu UIs and game states. I used an enumerator which did help, but was stuck switching between pause, play, restart etc.. I tried searching for a library and found this libsdl2gui but the problem was my phone app couldn't work with it. It's a reason I chose H-Craft as a learning curve to see how a bigger game handles so much stuff. Sorry for the switch over during a **** time :roll:

I did look into the Irrlicht API to try and see any way of controlling SOFTWARE stuff, but it's buried in the source folder and I don't want to copy paste the 3D Guru book's clipping code as I doubt CuteAlien would patch the software side anyway. So my journey ended with controlling software in Irrlicht. I did use one technique which broke the polys down (keep using divide mesh until the triangles are so small you won't notice much difference on the edge of the screen).

Also I went to a guitar group recently and the guy there is helping me learn things. He can tell me advice but I don't have to listen. If I stop being so dramatic I see he gives good advice so I'm sticking to the group.
You can create different loops and switch between them to order different tasks. You put a status condition, depending on the status, one loop or another will be started, and the necessary variable values will be passed.
**
If you are looking for people with whom to develop your game, even to try functionalities, I can help you, free. CC0 man.

Image
**
Post Reply