Freitag, 30. November 2012

Animation And Trees


Wow, last post is 3 weeks ago. I was a bit lazy for 2 weeks, but this week was very productive. In fact, I managed to do everything I wanted to do before I'm off on vacation for 2 weeks.

Well, what's new? Yeah, you guessed right: Animations and trees. More exactly: The player avatar now moves itself and I added some treeeeees. The graphics for those are placeholders, I hope I'll find some time soon (well, after the vacation) to make some better (or at least worse) tree sprites.

And, for the fun of it, here's a quick video of the new world:


You may see the character walking over the trees. Yes, they're not quite finished yet. After making that video, I implemented collision detection, so you won't be able to go through the trees anymore. Only thing that's missing: The character doesn't yet walk behind the tree. Maybe I find the time to fix this tomorrow.

However, this week was very good. Having added the animation engine, trees (with distribution) and basic collision, I'm both satisfied and motivated for the next bunch of things to do. Actually I'm not sure what will be next. Saving and loading maps would be a fine thing, though I still don't have a good idea on how to manage this. I also have to make something about the water, walking over it Jesus style isn't soooo good.

Spontaneous idea: I could add an option for how many different tiles there should be, automatically creating the textures and so on... mhhh... will think about that.

Well, that's all for today. See you in about 3-4 weeks, hopefully with a new update :D

Greenthings
The Wachmacher



Donnerstag, 8. November 2012

Introducing: The Player (graphics)

Hello there!

Today I'm (again) proud to share a new advancement for Foreign Worlds: The first five tiles of the player charakter!

*Cheers*
*Applaud*
*Happiness*

Yeah, I'm pretty dang proud, because of all the things I didn't understand up until now are graphics. Drawing is just one of those things I didn't really get, and seeing what I managed to paste together today, I'm (again) very satisfied.

Well, here he is:

Original size


Zoomed in a bit


And in the world



He's not that handsome and could use some improvement, no doubt, but still, I'm happy with Mr.... erm... Mr.... Mh, what should I call him?

Cheerio
Wakemaker

Donnerstag, 1. November 2012

Transition this!

I'm happy :)

First, something that I'm not very happy with, I stopped trying to implement the height map for the time being. Adjusting the graphics is so very complicated that I thought it would be better to go on without any height differences. I hope that at some later point in development I'll succeed in getting this graphic stuff together. But for now it's ... bla.

But now for the happy part: I added tile transitioning! Yaaay!
Nothing more to write about this now (me = very very tired), only thing left to do is put some pictures below for the whole world (^^) cheer with me for this great accomplishment.

Happy greetings
MakeWaker



Without transition
With transition
With transition

Without transition



Donnerstag, 11. Oktober 2012

Finalizing the height map

It's almost done. Just a few more switch-cases and it's good to go.

Today I finally understood this blog post (the one I mentioned in the last post)  or at least found a way to use it in my own game.

Let's resume how I managed the heightmap graphix so far.
For each of the edges and corners, I added 2^n to a byte value to find out which tile there has to be. Then I put that value in a switch statement to apply the appropriate graphic. In the end, that looked something like this:

case 11:
case 15:
case 43:
case 47:

Now that's not very efficient... But now I got how it can be down easier. Yay :D So I changed some function here, some other thingy there and it worked w/o any bug. Hooray for me! Now I first check the edges: if there's a different height, I'll have to apply some graphics, so I don't need to check the corners. If the height is the same, I check the corners. The calculation for the cases is pretty much the same, but now I only need 32 cases, not up to 256. All that's left to do is to clean up the code and get rid of all those unnecessary cases now.

The next thing to do after that will be the transition between the tile types.

Oh, and I need better graphics. Definitely...

Cheerio,
Wachmacher

PS: here are some screenshots of the finished height map:

A map with a lower zoom for the nosie generato -
zoomed out for better view

A map with a lower zoom for the noise generator -
zoomed out for a better view

A normal view of a map. Height map's done, yay!
Though it isn't very pretty yet. And water doesn't need it.




Mittwoch, 3. Oktober 2012

(Very) Small steps

So I had this problem with adding the height graphics to the borders of the maps.
For each tile, I check all the adjacent tiles to see which heights they are and add the corresponding graphic. Of course this doesn't work for the borders, since no map knows about the heights of the other maps. So I had to add a Dictionary (an array doesn't work here, since I need the coordinates 55/1 etc and nothing in between - please comment if there I miss something) for the border tiles, calculating the noise value for the adjacent tile check.

How many stupid errors one can do is simply amazing. I not only copied the parameters, having the octave value divided by 2.5 two times instead of just one (I do this for variation, so the height map is different from the tile distribution), I also interchanged various variables, esp. x and y values, subtracted 1 where it really shouldn't be subtracted, and so on. But, finally I got it working and learned a lot about stupid mistakes you can do.

Now I'm adding the rest of the graphics. I do this via a switch statement. Each of the 8 adjacent tiles get one value (1, 2, 4...) and adding the values for a single tile will tell me which graphic I have to use. I found the idea in some post I can't find atm and tried to adopt it. They managed to reduce the number of possible cases from 255 to 16 by using bits for each state of each adjacent field, while I actually have about 25, number still rising. But my system is a bit more complicated *sigh*.

Well, I'm just happy that I found all bugs (hopefully) and can continue to add all the cases/graphics for the height map.

So long
Se Wachmacher

Donnerstag, 20. September 2012

Adding some height to the soup

One of my biggest problems so far was the implementation of the height map in the renderer. Creating the height map wasn't the problem but to add the corresponding graphics to the screen...
Well, I'm far from having it finished but I took the first steps and am quite proud that I managed to get this far. I know it may seem a bit strange to be proud of something as unaesthetic as this:




But still, I got the idea and succeeded to add at least the impression of height, so that's a jump of joy for me ^^

Other problem I encountered is the map creation on the fly. It takes some time to create a new map, about 0.2s, and thus the picture stutters a bit. Can't wait to get to know Mr. Multithreading.
Oh, if anyone has some tips for me, feel free to post a comment!
Yes, I mean you, that one guy who happens to read my blog.

And I've got to admit, being a noob can be quite some fun because you've got so many new things to learn. And succeeding in these (rather easy, because basic) tasks gives a good pint of satisfaction.

Or to use the Doctor's words: Fantastic!

Cheerio
The Wakemaker


Samstag, 15. September 2012

The enemy of an infinite tile engine: negative coordinates

So, another step forward in my program: I turned my tile engine to be infinite!
At least I think so. It'll probably crash or shift to negative at tilemap MaxFloat.

And 'negative' is just the word I don't like in that. Like this guy, I ran into the problem with Perlin Noise and negative values. But unlike this guy I didn't find a way to solve this problem. Yeah, it would have been cool to start at 0/0 and then go for ever to the left or to the right. But alas, my unimaginable brainz aren't lack the capacity to solve this myste riddle. At least for now. And now may be a pretty long time.

But what the heck, then the game will start at something like 1.073.281 instead of 0/0. That's still plenty of tilemaps to explore.


Freitag, 14. September 2012

Pasting tilemaps together

Yesterday, I managed to put 4 tilemaps in a 2d array to hold them though I wasn't really that successful at all.

See this neaty screenshot of my paramount achievement:

 A concept of tilemap that didn't work.

This is were I started off today, and having only a bit experience with arrays and that stuff (lists of enemies etc. are quite easy but I never played around that much with arrays of coordinates) it took me quite a while to get the system working. But, finally, I think I got it. At least there haven't been any new bugs around for several minutes ^^

So this is what the same map & seed look like now (zoomed out a bit further):

Finally, a continuous map!

I don't know if it's a great idea but I use one 2d array to hold 4 tilemaps – the primary tilemap the player is in and 3 other tilemaps where he can go – and one bigger array with these 4 tilemaps to render the scene.
An Example: I have a tilemap consisting of 7x7 tiles: 1-1, 1-2, 2-3 etc.
The tile where my (atm non-existing) avatar will be held in array[0,0], the rest around it:

[0,0] = 4-4  ||   [1,0] = 5-4
[0,1] = 4,5  ||   [1,1] = 5-5

When I go from 4-4 to 5-4, after some tiles the tilemaps will get shifted within the arrays, so that [0,0] will hold the new array I'm in:

[0,0] = 5-4  ||  [1,0] = 6-4
[0,1] = 5-5  ||  [1,1] = 6-5

If I now decide to go upwards, the tilemaps will be shifted again, this time a bit earlier, depending on how near I am to the border. I 'm still in 5-4, but the arrays now are:

[0,0] = 5-3  ||  [1,0] = 6-3
[0,1] = 5-4  ||  [1,1] = 6-4

It took me quite some time to get this working, espacially the transfer was quite buggy, but I think now I got it working.

I also played around a bit with tilemap size and world size (i.e. how many tilemaps will be there) and found out the tilemaps shouldn't be larger than 80-85 tiles or else the performance will break down dramatically when scrolling diagonally. I think this has something to do with the way I check if I'm switching to a different tilemap.
On the other hand, having a lot of tilemaps doesn't seem to be a problem. Even with 50x50 tilemaps I had default 60 fps, though constructing the map takes a lot of time. But this will probably be because I create the whole map, not just a part of it and the rest on the go. Maybe I'll check that out tomorrow.

And because I'm so happy, here another screenshot of a map with a different seed:

From far away, this actually doesn't look that bad.


And that's it for today. Next I'll either try world creation on the fly, or I'll look how I can implement 3 to 5 levels of height.

But now a little killy killy antes de sleepy sleepy.

Good night,
Sleeptaker...

Mittwoch, 12. September 2012

About Foreign Worlds

In Foreign Worlds, you are a crew member of a spaceship that happens to crash in the orbit of a planet. You escape in a single-person escape pod like your other crew members do and then find yourself in a procedurally created world where you have to find your way to survive somehow.
Let's take a look at those italic words.

Survive
You land with only some equipment/tools and food in the escape pod and then you're on your own out there.   You'll have to find your way on the Foreign World you're on, building a shelter to sleep at night, finding food to fill your stomach, and find ways to keep you safe from the perils of the Foreign World: Diseases, animals, foreign tribes...

World
Your Foreign World is generated randomly in various aspects. This is the core of the game itself. Whenever you start a new game, a complete new 2d-world will be created: animals, plants, stones, tribes, colors, diseases, even the language the tribesmen speak will be randomized, making each Foreign World a unique experience for you to discover.

Sounds great, so how far are you with developing?
You know that expression pre-alpha? Add a ³ to it, that should be about where I actually am - pre³-alpha. At the moment, I'm agglutinating (yes!) the tile engine. It already has basic map generation, i.e. distribution of tile types (water, grass etc.) and basic heightmap generation. With basic I mean basic, there is still a lot of work to do. Next task is to realize the height map both graphically and passabally (look at my mighty brainz for I have neologismed one, no, two words for one of your puny languages, earthlings!). So, this will surely take a while to be in any condition to be shown to anyone. Take a cup of tea in the meantime.

- el wakemaker

Getting started... some days later

Hi there!

This is my little development blog of a game I'm creating, called Foreign Worlds. 

Its (the blog's) purpose is to be a nice little documentation of the work in progress and it's (the game) about some guy (you) stranded on a foreign world after your spaceship crashed on it.

It's my first real game project and the first time I'm programming anything in C#/XNA. Actually, I'm not a programmer at all, I started only 1.5 years ago with ActionScript and switched to XNA a few months ago, so this is big learning experience for me and probably will be full of all those flaws everyone has to learn. But at least it'll be fun, learning by creating something I'd always wanted to make.

Also, you can try to not mind my imperfect English skills. As a non-native speaker, I'm sure there'll be some (girls would say 'cute') grammar and spelling mistakes or strange idiomatic expressions like 'i think my pig whistles'. If you get it, you can keep it :D

All in all, I'm curious what this project will turn out and where I'll be in a year from now.

Cheers
Wakemaker