Posts by red51

    Thanks a lot for the world file :) I can confirm the crash on my end, so it's definitely a bug in the game. It seems there is an issue with the npcs... apparently the data for one or more npcs is invalid. Unfortunately the game doesn't validate the data, and since the game works with native memory here, this results in a crash.


    We will fix that with the next update, so the game first checks the data properly (to avoid crashes like that).

    If the npcs in your world aren't too important, you could fix this issue manually in the meantime by deleting the "Npcs.db" file in your world folder (also the "Npcs.db-shm" and "Npcs.db-wal" files if they're there). You should then be able to load the world again, but unfortunately this deletes all npcs in your world. If you want to keep your npcs, please let me know, then I can send you a fixed Npcs.db file ;)


    PS: That ship looks amazing, well done! :thumbup:

    Where can send it to ?

    If you could upload it somewhere (dropbox, google drive etc, usually these services always have a free version), you could send me the link either via PM, or alternatively send it via mail to support@jiw-games.net


    If the world isn't too large (you could zip it to reduce the size), i.e. not bigger than maybe 20 or 30 MB, you could also try to send the file via mail to us ;)

    New world loads and works the only other world that crashes is a Demo world

    Hmm... since when do you run into this crash? Is this the first time you try to load the world after the biomes update (from Februray), or did you already manage to load it successfully after the update?


    If it only happens with this particular world, it's most likely either a bug in the game (probably related to the Demo world), or an issue with the world files... is there maybe a chance you could send me your world? Then I could try to reproduce the issue on my end ;)

    If you could send me the world, make sure to include all files from the "New World" world folder.

    ..seems you cant use those in font for a GUI. Any ideas on how to get different fonts in a GUI like Medieval or Gothic?

    The Font enum (mentioned by james1bow ) is indeed the correct one - it contains all fonts of the game. It can be used for signs and UI elements ;) You can pass it to a label using the setFont() method (or alternatively set the style.font property on the label). Example:

    Java
    UILabel label = new UILabel("Hello World");
    label.setFont(Font.Medieval);
    label.setFontSize(64f);
    label.setFontColor(0xFFFFFFFF); // <- white
    label.setBackgroundColor(0x000000FF); // <- black (optional)
    label.setTextAlign(TextAnchor.MiddleCenter);
    player.addUIElement(label);

    Thanks for the report! :) It's a native crash (that's why it doesn't bring up an error dialog, for example)... native crashes are often (but not always) caused by something outside the game (usually the graphics driver, or another program which interfers with the game [like an anti virus program]).

    But of course it could also be caused by a bug in the game (there are some situations where the game works with native memory and pointers directly - this is prone to crash if something goes wrong).

    Native crashes could also be caused by the Plugin API, but that's only relevant if you actually use any plugins (in this case, the crash doesn't seem to be related to this).


    Does the crash also occur for all other worlds? What if you create a new world, does it load fine, or does it also crash?

    Sorry für die späte Antwort, aber wir können mit dem nächsten Update eine ScrollView einbauen ;) Dieser kannst du beliebige UI Elemente hinzufügen (auch komplexe Elemente) und grundsätzlich alle Arten von Listen, die es im Spiel gibt, nachbilden. Prinzipiell verhält sich die ScrollView wie ein reguläres UI Element, nur dass der Content scrollbar ist (und Childs außerhalb des Scrollbereichs unsichtbar sind).

    The log unfortunately contains no information about a crash... at the end of the log it seems the game just lost focus (alt-tab?). Apparently this log file isn't from a session which crashed?


    Please try loading a world until the game crashes (this is important), then restart the game to the main menu, open the console (with key ~ or `) and type report. Add some additional information like "game crashed when loading a world", and send the report. This automatically attaches the previous log file (which should contain more information about the crash) :)

    I was hoping to grab vanilla HUD elements and add children to them

    Oh, this is actually possible^^ But since this is a bit hacky (and may break with future updates), it's only possible through the Internals class. You could use the Internals.addUIElementToPlayer() method (instead of Player.addUIElement()) to add a UI element to an arbitrary target (this could be any UI element in the game).


    It's a bit tricky to find the correct path of an element on HUD, but you could use the uidebugger console command to get the target path of a vanilla element ;)

    Yeah, this is indeed a bit tricky... the game renders these icons during runtime, so there is no way to get them through the API right now :/


    But maybe it would help if we add a new "getIcon()" method to the ItemDefinition/ObjectDefinition/ConstructionDefinition classes (which would return a TextureAsset)? If you wanted to get a block icon then (e.g. with texture id 200), the code could look like this, for example:

    Java
    //Get construction definition for block
    Constructions.ConstructionDefinition def = Definitions.getConstructionDefinition("block");
    //Get icon for this block (texture id 200)
    TextureAsset icon = def.getIcon(200);

    However, this is where I am stuck on how to get the storage object with the inventory since this event Class does not appear to me to have method.

    I assume you are saying I get the chest using getStorage() then using Item[] getItems()? Because for me, the ToStorageEvent wont bring up .getstorage() as a method of the class.

    Unfortunately the storage API wasn't fully ready yet, but will be part of the next update ;) This will enable you to get access to all storages (or to create new storages, for example).

    Unfortunately this isn't possible :/ UI Toolkit does not expose the z order and provides no way to change it. Even though Unity added this feature to their roadmap 3 years ago, it's still not available yet...


    Right now the Z order depends on the order when these elements were created (and parents are always drawn behind their childs). There is no workaround for that...


    The problem is that I want to interlace with existing HUD elements, so I can't add them as a child to those. Maybe I could somehow grab them... 🤔

    Does that mean you want to change the parent of a vanilla HUD element?

    Basically it's important to either re-use existing connections (e.g. create a connection once, store it in a variable and re-use that connection), or alternatively close the connection once it's no longer needed. Everytime "getSQLiteConnection()" is called, a new connection is created. Same about "getMySQLConnection()".

    Only exception is the world database (this reuses the same connection automatically and doesn't need to be closed manually).


    If you re-use a single connection, it's important to close statements and ResultSets. This is a typical pitfall. For example, when calling executeQuery() (which returns a ResultSet), make sure to close the ResultSet once you're done with the query (i.e. almost always a few lines after your query). The easiest and safest way to do that is to use a try-with-resources block (it closes the ResultSet automatically, even if an exception occurs), e.g. like this:

    Java: Try-with-resources block (good code)
    try (ResultSet result = db.executeQuery("SELECT * FROM `MyTable`")) {
    while (result.next()) {
    //do something
    }
    }


    It's not recommendable to do it this way, for example:

    Java: Bad code
    ResultSet result = db.executeQuery("SELECT * FROM `MyTable`");
    while (result.next()) {
    //do something
    }
    result.close();


    The reason is that if an exception occurs between line 2 and 4, the result will never be closed (because an exception interrupts code execution, so line 5 will never be executed).

    You can "fix" this by using a try-finally block, but it's ugly and more verbose than the try-with-resources block at the very top:

    Java: Verbose code - it's better to use try-with-resources instead, as above
    ResultSet result = null;
    try {
    result = db.executeQuery("SELECT * FROM `MyTable`");
    while (result.next()) {
    //do something
    }
    }
    finally {
    if (result != null) result.close();
    }


    You don't have to close ResultSets if you either close the connection, or alternatively use getConnection() and create statements manually (and close them accordingly - because closing the statement will automatically close related ResultSets). But even in these cases it's still better to just always use try-with-resources blocks when working with ResultSets ;)

    Thanks a lot for your feedback! :) Sorry that I've missed your post on Steam... IDK why this happened :wat:


    1. The waterskin recipe still requires cloth to craft. Now that we have leather, I believe that resource should be the one to go. Maybe the devs forgot to update this recipe.

    Yeah, this was indeed an oversight, but we will change it with the next update ;)


    2. Also about recipes: The repeater rifle still requires gunpowder to craft. I am awared that it has been added as a requirement to craft the weapon as a "placeholder" for its amunition, which was unavailable before this patch. Bit now that bullets are a thing, my guess is that it is not required anymore. Once again, maybe the JIW Games team skipped this one too.

    Currently the rifle comes with 5 bullets by default, but probably it's better to remove the gunpowder requirement ^^ We'll change that with the next update, too.


    3. A great addition this update brought us is listing the food/water/health values of consumable items, a feature never done in Java Version. Also, bringing back the visible status values of clothes. This all is very helpful for sure! However, there is one point missing: The values of weapons, like damage, attack speed, etc... This was huge flaw of the old version (we had to check the forums for this), so if you could add this one feature as well, the gameplay would greatly improve.

    Unfortunately the game cannot get the attack speed from the database (because it solely depends on the animations), that's why no DPS is exposed yet... adding this is still on our to-do list and probably will be available with one of the next updates. But maybe we could at least expose the "damage per hit" in the meantime until more information are available ;)


    4. Speaking of status, it would also be a huge quality of life improvement if the game allowed us to see the status of wearables, weapons and food items at the crating screen, before we craft/cook them. This way, we would be able to know if they are worth making without being forced to waste resources for this, or doing unnecessary web search.

    Good point! I'll put this on our to-do list ;)


    5. The animal are too powerful! My character was hearing the leather outfit and the medieval mining helmet. It all gave a combined armour value of 50 points. And even so, after engaging rams or goats, they reduce the health bar to nearly half in 3 headbutts! And they are not even the "true" beasts! So, I believe this point of gameplay could use some revision. Or the devs could add a combat difficult setting to make things easier for those that so desire.

    Yes, animals are indeed too strong... we will reduce the damage with the next update, but probably we'll also add a "hit damage factor" setting (but only available through the config file for now).


    6. Another animal threat point: Bears on the grass fields. Of all the additions and tweaks this patch brought us, this is the only one I consider a bad move. I mean, those biomes are supposed to be a "safe haven" for our character to do the very early game progression, like basic weapons and tools, so why make the most power animal of the temperate islands spawn there?! I understand that maybe the dev team don't want to make that territory too peaceful and boring, so there is some theat. But at least make it be boars or wolves, when they become a thing, not effing bears! This is so unfair... And before you mention it: I understand that these animals may inhabit such biomes in real life, but this is a game, not a wildlife simulation, so a good gameplay comes first.

    This was mentioned a few times, so maybe it's better if we remove bears for now from the grass field ^^


    7. And one last point on animal aggression: I am not sure, but it seem that killing an animal with a headshot don't aggravate the rest of the herd. They react if the attack is not lethal, but seem to ignore the death of their "mate" if it is. Probably there is a bug here. Note that this only affects defensive animals, the passive ones still run away on headshoted herd members.

    Defensive animals currently ignore if you attack one of their mates... previously they already got angry if one of their mates just got the "alert" state (which was already triggered by a gunshot or when cutting down a tree, for example), but players were confused by this behaviour. So right now they just ignore it.

    But some changes to this handling are still on our to-do list :)

    Oh, du startest dort leider die alte Java Version, der Server ist (lt. Log) allerdings bereits der für die neue Version... wenn du die neue Version spielen möchtest, musst du diese im Beta-Branch auf Steam auswählen und anschließend über den Steam-Client starten - dann erscheint eine Auswahl, wo du "New Version" auswählen musst um die neue Version zu starten :) Hier sind ansonsten noch ein paar Infos dazu: https://forum.rising-world.net/thread/11060


    Du kannst auch anhand der Versionsnummer (unten links im Hauptmenü) prüfen, ob die Java Version oder die neue Version läuft: Wenn es 0.7.0.3 ist, handelt es sich um die neue Version.

    Tut mir Leid zu hören, dass es Probleme mit dem Server gibt :/ Ist der Server denn generell nicht erreichbar (wenn man direkt über IP verbinden möchte), oder taucht er "nur" in der Liste nicht auf?


    Bei mir ist der Server allerdings in der Serverliste sichtbar :thinking: Auch über den Browser kann er abgefragt werden: http://77.116.246.46:26014/

    Ich kann scheinbar auch connecten, also soweit scheint da eigentlich alles zu stimmen. Auch obiger Log sieht korrekt aus.


    Nach dem Serverstart kann es aber bis zu 1 Minute dauern, bis der Server in der Liste auftaucht. Manchmal gibts auch Probleme mit den Steam-Servern, wodurch der Steam Masterserver manchmal nicht erreichbar ist (und neue Server dadurch auch nicht auftauchen).

    Yes, wildcards work in combination with a LIKE operator when working with the world database. Make sure to put apostrophes (') around the name (single quotes represent SQL strings), i.e. one on the left, one on the right. For example, if you have a player name "angriff" and want to find all npcs which are called "angriff" followed by 2 digits or letters (e.g. "angriff01", "angriff42", "angriffXY" etc), the SQL statement would look like SELECT COUNT(*) AS count FROM npcs WHERE name LIKE 'angriff__';. Since your player name is a variable, you have to use string concatenation. The code could look like this:



    Please bear in mind that the _ wildcard character represents one character, while % represents zero, one or more characters. So looking for "angriff__" (with 2 underlines) will find "angriff01", "angriff42" etc, but not "angriff1", for example.

    There is unfortunately a bug when accessing a ResultSet via index... in JDBC, the leftmost column in the ResultSet begins at 1. So in an SQLite or MySQL database created through the Plugin API, you could access the count like that:


    Java
    try (ResultSet result = db.executeQuery("SELECT COUNT(*) FROM `mytable`;")) {
    if (result.next()) {
    System.out.println("Count: " + result.getInt(1));
    }
    }
    catch (Exception e) {
    e.printStackTrace();
    }


    However, the world database uses our native SQLite implementation instead. In SQLite, the equivalent of result.getInt() is sqlite3_column_int(), where the leftmost column begins at 0 (instead of 1).

    You could fix that by accessing index 0 in the result set, however, since this isn't consistent with the regular JDBC implementation, we will change that with the next update (so I wouldn't recommend using that now).


    Instead it's probably better for now to use an alias for the count and access the result through that name:

    Java
    try (ResultSet result = db.executeQuery("SELECT COUNT(*) AS count FROM `mytable`;")) {
    if (result.next()) {
    System.out.println("Count: " + result.getInt("count"));
    }
    }
    catch (Exception e) {
    e.printStackTrace();
    }