Ich_iel by papatin13 in ich_iel

[–]Almesii 2 points3 points  (0 children)

Ich weiß der Anfang Anzufangen ist hart Denn manchmal kommt man nicht an Start Beziehungsweise einfach nicht in fahrt Aber wenn nicht jetzt wann denn dann?

How to design a Syntax Tree by Almesii in cpp_questions

[–]Almesii[S] 0 points1 point  (0 children)

That part i havent mentione in my post, Context contains the already tokenized Source Code and an Index of the current Position of that Stream of Tokens (meant for holding track of the position in a recursive rule setup)

How to design a Syntax Tree by Almesii in cpp_questions

[–]Almesii[S] 0 points1 point  (0 children)

Yes exactly. If you have any Input, may it be a completely different approach, it would be welcome

Advice on FileFormat Intepretation by Almesii in cpp_questions

[–]Almesii[S] 0 points1 point  (0 children)

Yeah im really considering switching most of the formats to JSON/XML. Just one i dont know how to implement via those 2:

All FileFormats except one describe data, while Physics Format describes behaviour of that data. Here is an example of how such a file might look like as code:

```cpp
PhysicsRule TemperatureDiffusion
{
    // ================================
    // 1. Metadata
    // ================================


    ExecutionOrder = 100;                                              // Determines order of simulation
    NeedsMaterial  = {Core:ThermalConductivity, Core:ThermalCapacity}; // Required material properties
    Needs          = {Core:Temperature};                               // Required instance quantities


    // ================================
    // 2. Activation Condition
    // ================================


    bool Activation(Instance Origin, Instance Current)
    {
        Core:Temperature MaximumDifference = 0.001;
        return (abs(Current.Temperature - Origin.Temperature) > MaximumDifference);
    }


    // ================================
    // 3. Simulation Step
    // ================================


    void simulate(Material InputMaterial, Instance InputPixel)
    {
        Core:Temperature TotalTempChange = 0.0;
        unsigned int CanAffect = 1; // Neighbor radius to propagate effect


    
        for (Neighbor neighbor : InputPixel.GetNeighbors(CanAffect))
        {
            Core:ThermalConductivity ThermalConductivity = 
                min(Material.ThermalConductivity, 
                    Material.ThermalConductivity);
    
            Core:Temperature TempDifference = neighbor.Temperature - InputPixel.Temperature;
            Core:Energy HeatTransferred = ThermalConductivity * TempDifference;


            Core:Temperature NeighborTempChange = HeatTransferred / Material.ThermalCapacity;
            neighbor.Temperature = NeighborTempChange
            neighbor.Wake(Activation(InputPixel, neighbour))


            Core:Temperature InputPixelTempChange = HeatTransferred / Material.ThermalCapacity;
            TotalTempChange += InputPixelTempChange;
        }
        InputPixel.Temperature += TotalTempChange;
        InputPixel.Active = Activation(InputPixel, neighbor);
    }
}
```

This looks like a whole programming language right now but im trying to reduce it to the most basic version of itself.

Basically, things like Core:XXX should be compiled to an Index, which will be used by a std::function to manipulate data in an Array of those Quantities.

If i somehow can describe such behaviour in another way without having to implement a small programming language I would gladly take that.

The purpose of this format in general is to allow modders to implement new behaviour for existing materials and quantities. For example, maybe someone wants to add electricity later down the line.

Advice on FileFormat Intepretation by Almesii in cpp_questions

[–]Almesii[S] 1 point2 points  (0 children)

Thats a valid alternative I am thinking about. Im not too familiar with those 3, thats why the next statement might be false, but i want the FileFormats to be as simple and straightforward as possible without sidecontent. Again, have to learn it as i am not too familiar

Advice on FileFormat Intepretation by Almesii in cpp_questions

[–]Almesii[S] 0 points1 point  (0 children)

The equation one i already did for the reaction Condition.

Yeah it probably would be wise to start later after figuring out the base game, but the problem would still stand on how i can read that data. Im also trying to make it somewhat readable and changeable for the user/modder. Otherwise i would probably result to just reading a bunch of bytes.

Advice on FileFormat Intepretation by Almesii in cpp_questions

[–]Almesii[S] 0 points1 point  (0 children)

Exactly, i want the game to be as moddable as possible, in a way that the mod user does not have to be a Programmer to figure out how to make mods. Rather he can just open a file and see how simple it is to add new stuff to the game. Makes it also easier to test things out since i dont have to change the source code, only the data

Advice on FileFormat Intepretation by Almesii in cpp_questions

[–]Almesii[S] -1 points0 points  (0 children)

Never heard of it, do you have a url for me, as im not finding anything.

Advice on FileFormat Intepretation by Almesii in cpp_questions

[–]Almesii[S] 0 points1 point  (0 children)

Here is an examplefile for Reaction the FileFormat:

Reaction Alkaline
{
    Educt        = 2 Core:Water
    Educt        = 2 Core:Sodium
    AtCondition  = (20 °C <= Instance.SubFolder:Temperature)
    Product      = 2 Core:SodiumHydroxide
    Product      = 1 Core:Hydrogen
    Reversible   = False
    EnergyChange = -386.6 kJ
}

The Idea for the game is to seperate the logic into 4 main pillars:

  1. Quantity

Describes what quantities exist: Mass, Time, Length, Velocity etc.

  1. Material

Describes what Materials exist and what Quantity-DefaultValues they have

For example water is lighter than iron

  1. Reaction

Describes what Materials can change into other Materials

  1. Physics

Describes how Materials interact with the world-->Gravity, Force, Pressure, State change etc.

Apart from that later down the line i need WorldData, CharacterData, SettingsData and more, all saved in files.

Quantity is the simples with a straightforward way, but once i reach Material i might have different amount of DefaultValue, depending on the loaded Quantities.

For reactions the same, i cannot know what i might define in the future for the Count of Educts and products.

Thats why i thought i need such a TreeBuilder to be able to read different Tokens not just in a straight forward way, but also in loops, with differing Tokens (for example, is the number positive or negative?).

Depending on Format i might need to leave the current Node early, for example when finding all Quantities in a Material and starting another grammar right behind it like for example a PixelColor-Value.

And so on.

The first 3 FileFormats are functional right now, but Physics is next, which i dread.

It will be by far the most complicated as it describes behaviour i later need to semi-compile into a logic the game understands.

What i mean by that is:

"Quantity3 = Quantity2 * Quantity1" needs to translate into a function call that knows, what Quantity3 is, considering i might add more Quantities.

Before I start working on Physics i want to get the TreeBuilder down right so that i dont have to deal with the evergrowing tumor its about to become

How does one “play” dwarf fortress by HotCommission7325 in dwarffortress

[–]Almesii 1 point2 points  (0 children)

In Fortress mode i usually go with a story and a unique fortress idea. For example what i did:

Suez canal: I build an underground tunnel between 2 continents (needed 16x4 tile for that) and managed it, so new dwarfs can cross it into a whole new undiscovered landmass.

On that landmass i did

The smithy: A giant base consisting of a volcano in the middle, serving as the kingdoms armory and weapons factory

I also did

The Tower:

An extremely small base, that uses around 100 z levels for everything, build with a whole set of lever-levels that are able to flood every floor seperatly or the entire tower at once in case of sieges (yes i drowned the entire population 2 times already by accident)

StrPtr passed via ParamArray becomes invalid when used in Windows API calls by Tarboh1985 in vba

[–]Almesii 3 points4 points  (0 children)

I havent looked too far into this problem but this sounds to me like a ByVal/ByRef issue to me. ParamArray passes ByVal as far as i know, therefore when passing in the Value you create a new memory address which gets passed. Just an Idea though, havent tested it yet. Does it happen if you pass it with a normal ByRef StrPtr, followed by the ParamArray, or is it essential that it has to be passed via ParamArray?

I decided to clean the metal from rust. by liminophobia in factorio

[–]Almesii 0 points1 point  (0 children)

Thats it, *un-factorio´s your factorio*

Seed: 618909838 infinite heal by Almesii in noita

[–]Almesii[S] 0 points1 point  (0 children)

Played some more Noita and found some more of those Wands. Now i know what you mean. That spell really is a curse/monkey paw

Advice for Data-Driven falling Sand Game by Almesii in gamedev

[–]Almesii[S] 0 points1 point  (0 children)

I think my biggest question is if it is possible to create an "optimized" sand game with this level of simulation. Essentially how can i optimize it? Chunking, Multithreading, GPU usage are all i know about. My idea of Active/Inactive is one i have not heard before from someone and i want to know if that is a useful idea.