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 #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

Early Access Update #7 – Beta introduction, new item system, and more worlds


Hi friends,

It’s Friday and time for another Early access update! Let’s start with an overview of what’s changed in this update, and then I’ll go into more detail on some of the bigger changes for those that want it!

Let me preface the following by saying that this update has gone to the beta channel. The last update I just pushed live and it had a bug. For this one It’s gone to the beta channel and will go to the standard channel in a week or so if no bugs are found.

To access the beta channel, right click Samphi in your library >> Properties >> BETAS, and select the only beta channel there is. That will get you v0.1bu (u for untested). At any point, you can opt out of this and go back to the stable channel and build.

All codes should give access to this beta, but if anyone has any problems just let me know.

Right, on with the changelog:

  • Re-coded items. They are now somewhat open to modding later down the line. (Explanation to follow)
  • Items can now be snapped to/from the crafting bin by holding shift and left clicking.
  • Updated world select screen. It was like this a long time ago and I recently found a screenshot and wanted to go back to it!
  • Opened up the other worlds so you can now have 5 worlds
  • Fixed issue where the player was underneath the door
  • Fixed issue where you couldn’t place backing walls behind doors
  • Changed sprites in custom_textures folder back to normal

Okay, so let me explain what’s happened with the items a little bit. In an earlier update, I changed the name of an item and the game really didn’t like it. I looked at the item code and it wasn’t a quick fix, so I re-coded it. It needed doing. Be it now or later, that code needed updating so I just went for it.

One of the changes to gameplay is that you can now snap items to/from the crafting bin by clicking an item while holding [Shift]. So [CTRL] and hovering over an item will show a description, and [Shift] and click will snap it to/from the crafting bin.

While I’m here, what I think I’m also going to do it separate item information from the game into a config file. This way item name, descriptions, and images can be modified. It’s not a huge job, so that should come pretty soon.

Samphi always had 5 world slots, but 4 were turned off. Well, they’re now on! You can have 5 separate worlds now, with 3 individual characters and they aren’t tied together. You can place any character in any world and mix and match.

Again, while I was here I made a slight cosmetic update. A long time ago Samphi’s world creation used to look like this:

I always liked this and don’t really know why it changed. I found this old screenshot and decided to go back. The world sprites, like all sprites in the game, are not final, but I love having little worlds there. Do you prefer the worlds or the text?

If you haven’t seen already I released a guide covering the creation and use of custom_textures. If you haven’t read it, definitely go take a look and start modifying Samphi!

Since this update hasn’t seen much added to gameplay, next update will be entirely focused on that. Here’s what I think I’ll be working on:

  • Adding Chests
  • Adding Iron
  • Adding Sheers
  • Adding Wolf
  • Adding new crop

Those are the things I want to get working on next, so let me know what you think.

Hope you’ve all had a great week and have an even better weekend ahead! It’ll be solid dev for me, get some fresh content added! 🙂

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