Early Access Update #18 – Hold onto your butts, 0.2a has landed

No, you’ve not read that wrong. Over a month since the last update, the item system re-write is complete and has been pushed out in 0.2a to the beta branch. We have a little bit to cover so get your cup of tea ready and sit back.

All updates over the last few weeks have documented the trials and tribulations of the item system re-write well, so I won’t cover it in much detail. The bottom line is Samphi now has a new item system that can deal with multiple item stacks. A seemingly small change on the surface, but massive in under-the-hood.

Given how much of the game changed for this, and how many possibilities it opens, I felt this was a good time to roll over to 0.2. Chests still aren’t in yet, they’re the whole reason we had to do this! but they will be next week. The game is now set up to accommodate them, I just didn’t have enough time to squeeze them into this update and we need to get testing ASAP.

Something I’m very aware of is the size of the item stacks. I think they may be too small, so I’m going to be looking for your feedback on this one. Have a play, and if you think an item should have a greater/lower stack size or stack/not stack altogether then let me know. Tweaking and getting these right will be a gradual and on-going process that starts today. 🙂

Another major thing 0.2 brings is partial language support for Italian, Spanish and Turkish. I say partial because it only effects items and their descriptions. UI text is soon to follow, however, so as we go forward this will get better and better.

I’d like to remind people that I’m always looking for translation volunteers, particularly Russian! If you’d like to help out drop me an email at greeny@greenygames.com.

I showed the new graphics in an update a while back, and they’re now in the game. For now, it’s just the settings and language menu, but I intend to roll this out to different parts of the game gradually. Please do let me know what you think!

Right, major systems explained, here’s everything that 0.2a is bringing to the table:

  • Fixed bug in menu with menu going behind terrain etc.
  • Fixed bug in settings menu where pressing ESC would leave windows behind
  • Implemented language menu in settings. Language effects item names and descriptions, more will come soon.
  • Added new art in new style in settings menu.
  • Implemented new item system. Samphi now supports multiple stacks of items and items now have max stack sizes. This means you’ll loose your items I’m afraid. 🙁 Sorry!!!!
  • The crafting system also got a big change-up, something along the lines of a 50% re-write. There’s still things I’d like to change here, but we can do them later and they’ll be MUCH less disruptive.Time for a warning. A massive portion of Samphi has been re-written here, so there WILL be issues. As usual, 0.2a will be pushed to the beta branch, and instead of keeping it there for one week, I think I’ll keep it there for 2. Make sure as many bugs are found as possible.

    Also, I’m really sorry about this, but your item data will be lost. 🙂 I tried everything to make that not the case, but this new system needed a more flexible saving system. I’ve always been open about Samphi save data. I don’t encrypt it or anything, I think that’s so stupid. If you want to give yourself 1,000,000 of an item, then be my guest.

    To try to soften the blow of the changeover, I’ve written an article that explains the new save data format. If you want to move your old item over, read that article and you’ll know how to add items to the save file.

    http://www.samphi-game.com/blog/2016/06/24/samphis-new-item-save-data-format/

    Now that this big update is out I’m going to spend a few days on web stuff. My website for Greeny Games has been down for weeks now, and the Samphi website is feeling derelict. I don’t post articles there yet so I want to spend some time there.

    The wiki system is going to be a big part of that also and I’d like to get it in a functioning early version very soon.

    Now that this is complete we can get back to adding content! I have chests and new crops on the list immediately, so let’s start there. I also have a cool idea for the main menu that I’d like to explore and want to continue moving the older graphics over to the new. This graphical changeover will take a while, so you’ll notice more and more changing as the updates roll through.

    Have a fantastic weekend, and enjoy 0.2! Great things are coming!

    As always you can show your support and keep up to date with development by following me here:

    Visit my websites
    Greeny Games Website[www.greenygames.com]
    Samphi Website[www.samphi-game.co.uk]

    Follow me on Twitter
    Greeny Games Twitter
    Samphi Twitter

Samphi’s new item save data format

From 0.2x onwards, the way in which Samphi saves player item data is vastly different. I apologise about that, I tried to make it cross-compatible, but the new item needs more flexibility in how it stores data and the old system just can’t provide that.

I’ve always been open about people editing their save files. If you want to give yourself 1,000,000 of an item, you should be able to. This article will outline how the new item save data works, so you’ll be able to move over your old items, or give yourselves new ones whenever you want!

Here’s how the new save file for item data looks:

icon_count=”2.000000″
0i=”37.000000″
0q=”1.000000″
0p=”2.000000″
0c=”0.000000″
0s=”0.000000″
1i=”4.000000″
1q=”1.000000″
1p=”1.000000″
1c=”0.000000″
1s=”0.000000″

Looks like nonsense at first, but let’s go through it line-by-line.

icon_count=”2.000000″

Icon count is the number of items that the save file has to load. Pretty self-explanatory! This should simply match the number of icons you have data for.

0i=”37.000000″

From here things get a little more cryptic. Starting with the first character, the number at the start of the line is the index of the item. In programming we start counting from 0, so in the line above the 0 means it’s the first icon that the game will load.

All lines start with the index; the next character determines what type of data it is:

0i=”37.000000″

Item id. All items in Samphi have an index. In this case, the id is 37 so that’s a spade item. There is a lookup table at the end of this blog showing all id’s, and once the wiki is up and running fully you’ll be able to easily find them there also.

0q=”1.000000″

item quantity. This is simply the number of items in the stack.

0p=”2.000000″

Item position. This is which slot the icon belongs in. Be sure not to give 2 items the same item position as it will cause problems in the game.

0c=”0.000000″

Chest index*. This is which chest the item is in. So for example, if you had 2 chests in your level, and you wanted the item in the first you

0s=”0.000000″

0s = chest slot*. This is the slot index for which slot of the chest the item is in.

So that’s what all the values mean! The way Samphi loads data is by first reading that icon_count value, and then counting up from 0. So, remembering we start counting at 0 in programming, let’s say our icon_count value is 3. In this case, we’ll be reading items which start with 0, 1, and 2; three overall.

Practical examples are always best, so let’s look at one. Let’s work with the same data as before:

icon_count=”2.000000″
0i=”37.000000″
0q=”1.000000″
0p=”2.000000″
0c=”0.000000″
0s=”0.000000″
1i=”4.000000″
1q=”1.000000″
1p=”1.000000″
1c=”0.000000″
1s=”0.000000″

Here we have 2 items, one is a spade (37), and the other is an axe (4). Let’s assume we want to give ourselves 20 wood. First, we need to update our icon_count value as we now have one more item to load:

icon_count=”3.000000″

Now we need to add the details of our item. Remember, we already have 2 items here, and we’re adding our third, so all lines need to start with the number 2 as that’s going to be the third one loaded. [0][1][2].

We’ll start with what item we want and how many of it:

2i=”45.000000″
2q=”20.000000″

Now we need to choose its slot. Remember not to give two icons the same value here. We can see that our other items have the slots 1 and 2, so let’s stick it in slot 3:

2p=”3.000000″

I’m not going to show the chest slots, as I advise putting items in chests in the game. But if you do want to tinker, just remember that xC means chest index, and xS is the slot in that chest. For this example, I’m leaving them blank, but they still need to be there! We just use 0s.

2c=”0.000000″
2s=”0.000000″

Pulling all that together we get the following data:

icon_count=”2.000000″
0i=”37.000000″
0q=”1.000000″
0p=”2.000000″
0c=”0.000000″
0s=”0.000000″
1i=”4.000000″
1q=”1.000000″
1p=”1.000000″
1c=”0.000000″
1s=”0.000000″
2i=”45.000000″
2q=”20.000000″
2p=”3.000000″
2c=”0.000000″
2s=”0.000000″

That’s the save data. A little complex on face value, but actually not too bad. There are issues like having to ensure you use the correct slot value, but I plan on creating an editor for this type of thing later down the line. Same goes for level editing, I want to build a tool for it, so there’s no point in creating a robust editing system now when it will be rendered defunct down the line.

Hopefully, this will enable you to make changes to your data and potentially restore any lost item from moving between versions 0.1x and 0.2x! Thanks for reading and all feedback is welcome. Here’s the item lookup table as promised!

ID Name
1 acorn
2 apple
3 arrow
4 axe
5 backing
6 bed
7 bench
8 berry
9 bow
10 bread
11 bucket
12 chest
13 cloth
14 dirt
15 door
16 iron ingot
17 iron ore
18 fat
19 fence
20 fire
21 fish
22 fish cooked
23 flax
24 glass
25 hammer
26 honeycomb
27 kiln
28 ladder
29 pickaxe
30 rock
31 rock sharp
32 rod
33 rope
34 sand
35 seed
36 shears
37 spade
38 stalks
39 stick
40 straw
41 sword
42 torch
43 wall
44 wheat
45 wood
46 wool

Early Access Update #17 – We’re getting there …

Happy Friday amigos, it’s update time.

Bet you can’t guess what I’ve been working on this week … Bloody icon system. Things are actually going really well, but there’s nothing to show for it since it’s all engine work.

Instead of spending a while pulling together random images to justify an update I’m just going to leave this week very thin and get right back to work. After spending so much time on this system I figure the time’s better spent on actually coding! 🙂

So, quick sitrep from me this week then I’ll be off:

  • The core of the item system has been successfully re-written
  • All function surrounding items now need to be recreated
  • Items are currently function in the game at a basic level
  • The new system is much more flexible and allows the game to move forward

So that’s where things are at right now. 🙂 Going well!

A valid question at this point is, ‘Why mess with it in the first place?’.
Well, the item system has always been janky. Samphi started as just a fun project. The goal initially wasn’t to create a full commercial game, so whenever I wanted a feature I bodged it in.

I realise bodge is a British word, so here’s the definition according to Google!

That’s how much of Samphi was built; a mess of bodges. As the icon system grew I continued the bodge, adding features however possible, but it reaches the stage where to move forward you have to start again. You can only bodge so much! That’s why the re-write.

Hopefully I’ll have the items system to show; Get some screenshots of some double item stacks or something. Some form of graphical confirmation of the engine work that’s been done. I said in the last update that I had crops and a new animal planned, which I do, but just didn’t get round to them for this week. All focus is on items for the time being.

So, short update. 🙂 There’s only so many ways of saying I’m still working on items, but rest assured they’re coming along great; just slower than originally anticipated.

Have a great weekend all, and speak to you in 7 days!

As always you can show your support and keep up to date with development by following me here:

Visit my websites
Greeny Games Website[www.greenygames.com]
Samphi Website[www.samphi-game.co.uk]

Follow me on Twitter
Greeny Games Twitter
Samphi Twitter

Early Access Update #16 – v0.1e stable, more graphics and language menu

Update time friends, these come so fast!

Work is still focused on the time system re-write. Great progress has been made though! Not quite ready to show anything, 99% of it is under-the-hood, but we’re getting there. I do have a few things to show however!

Before we get started, something has been on my mind the last few updates, so let’s talk about it. Would you prefer weekly updates like this with less in them, or more substantial updates every 2 weeks? I like the frequency of weekly updates as we stay in touch more often, but I always feel like I don’t have enough to show.

Any feedback here would be really appreciated. 🙂

Right, onwards.

In the madness of working on v0.f I neglected the previous build and it’s been in the beta branch for the last few weeks. That’s now been moved to the stable branch, so you should get an update to Samphi tonight. Here’s a reminder of what that update brings:

  • Samphi is now compiled with Windows YYC, so we should see a speed increase! According to GM, YYC can ” increase your games performance by a hundred-fold”. Let me know how this goes.
  • Hopefully fixed a bug where music was playing twice in the menu. I say hopefully because I could never recreate it, but I put something in place that should stop that ever happening.
  • Fixed a bug where feeding honeycomb to your dog would cause the game to crash.
  • Fixed a bug where small items disappear in water and the ground.

In-between my coding jobs I’ve been continuing to move the graphics over to this newer style. I’m really loving it! The settings screen has been updated, and the inventory screen has. Here you can see them side by side:

What do you think? It’s a bit hard to make a judgment when the art is so isolated like this, but I love the new style and font. As you can see, the font of these updates has been moved over also! Feedback appreciated.

The last few updates have mentioned and showed some things to do with language, and a language menu has made its way into the game this week. In the main settings screen there’s a new ‘Language’ option that will show the following menu:

Really simple way to select a language. When the next update comes out this won’t likely be 100% plugged in. It will change the name and descriptions of the items, but probably nothing more. That consists of more work, and this update was already taken too long.

The next update … Who bloody knows. 😀 I’m bored of talking about icons, so I’m sure you’re bored of hearing about them.

I have a few new crops planned, and a new animal! Hopefully, will have some art for those to show. No doubt I’ll also move more UI over to the new style, so stuff there also. Depending on what you guys think about my first point on update frequency, this will either come next week or the week after. Please do let me know.

Just want to say thanks for your patience. I wish I could pump out updates to Samphi much faster that I am but it’s just not possible. I work full time and am a one-man-band. I love Samphi and am very excited for the path we’re on, we’re just traveling down it steadily for now. 🙂 But please know that increased update times is purely down to circumstance and the size of the updates, not any diminishing passion for the project.

I’ll work on Samphi indefinitely until it’s the game I have in my mind. We’re still right at the beginning of that journey. 🙂

Okay, rant over. Go enjoy your weekend, speak soon.

As always you can show your support and keep up to date with development by following me here:

Visit my websites
Greeny Games Website[www.greenygames.com]
Samphi Website[www.samphi-game.co.uk]

Follow me on Twitter
Greeny Games Twitter
Samphi Twitter

Early Access Update #15 – Let’s Get Technical

Update time friends.

Well, it’s been another solid week of engine stuff so unfortunately there’s really nothing to show. 🙁 Instead of not putting out an article, I figure instead why don’t I explain exactly what I’m taking so much time doing, and why I need to re-code the item system in Samphi.

If you’re not into looking behind the scenes, then this update won’t be for you I’m afraid. Feel free to pop back next week! For those interested, let’s get started.

The following changes are required of items, and are the reasons behind the re-write. I’ll address each in turn:

  • Ability to deal with multiple item stacks
  • Ability to save items in chests
  • Ability to load custom item names/descriptions
  • Moving items from string IDs to numeric IDs

The first problem we’ll look at is with item stacks. To accommodate chests, and other future plans, Samphi needs to be able to deal with multiple stacks of the same item. Currently, all item data is stored in a single list that looks something like this:

The amount of each item is tracked by the game, not the icons, so that means if you create two icons for the same item they can’t have independent amounts. For example, if you have one stack of apples in a chest, and another on your hot bar, each time you collect an apple they will both go up, and both show the same amount.

This is the biggest issue with items as this list system is heavily used in most areas of the game code. It was silly to set the game up like this in the first place, but if everyone knew everything right off-the-bat we’d all be professionals. What I’m currently doing is moving away from this main list and instead store quantities in each icon.

The second issue that needs addressing is changing the way the game saves/loads items. Currently all item data belongs to the player, and is stored in player data files. That means you can’t really store items in a chest. With the current system, if you created a chest in a world, then used that world with a new character, the items wouldn’t be in the chest. Not very useful.

To fix this, the game needs to save items that the player currently has equipt in the player data, and save items in chests to the world save file. This isn’t really a bad job, and shouldn’t take much time.

This one’s also not a big issue but goes along with the icon re-write. Currently, icons’ names and descriptions are hard coded. That means in the actual object itself in code I set these values myself. In order to support multiple languages freely, this value needs to be set externally.

I’ve moved items to loading their data from an external ‘.sam’ (my extension that’s functionally the same as .txt) file based on what language is currently selected. A system like this means it’s very easy to add more languages, and allows users to configure their own descriptions and names for items should you wish to do so. When the next update comes out there will be support for English, Italian, Turkish and Spanish. 🙂

This one is very programmy and won’t result in any changed functionality. Very simply, icons are currently distinguished by their name. So, I know the apple item is an apple because its name is ‘apple’. This isn’t ideal for a number of boring reasons, so I’m moving over to a numerical id, so I’ll know the apple icon is an apple because it will have an ID of 1.

Once all of these things has been done Samphi will have a MUCH more stable and flexible item system. We’ll be able to have multiple item stacks, chests, customizable names and descriptions etc. It sucks because it means that periods go where the game doesn’t seem to change, but hopefully this post illustrates some of things that are happening under the hood. 🙂

Next update there’ll hopefully be something to show from this boring engine work! Maybe get multiple item stacks running, then getting those other smaller jobs complete.

Either way, I’m making good progress with this work, so be it in the next update or the one after, I can see the end of tunnel and dev can get back to adding game content!

Hope you all have a great weekend, and if you have any questions drop me a comment!

As always you can show your support and keep up to date with development by following me here:

Visit my websites
Greeny Games Website[www.greenygames.com]
Samphi Website[www.samphi-game.co.uk]

Follow me on Twitter
Greeny Games Twitter
Samphi Twitter