So i planned out a list of what needs to be done first and what will benefit being done before what ect in my codename Project Blue Inventory project..
I ended up creating an awesome Window Manager! It creates, removes, hides, shows, renames Windows made for the User (on-screen windows, not popups). Kind of like User Interface Containers! I think it’s a great addition and im pretty proud of it for less than a days work.
You can even drag them about using the header bar and resize them, cool!
(The screenshot is very basic, it just shows that i created 2 dynamic windows using the Window Manager, and used one of them to add debugging information to)
Lately i havn’t been bothered to do much coding, gaming or anything else in that matter, just alot of movies and Youtube i guess.
Everytime i opened up Notepad++ i would just sigh knowing of all the different projects i still havn’t got around to complete yet.
I am of course still so excited about the Project Blue Inventory game in Canvas, and the Halfling-Life game (Although Halfling-Life is on hold for now).
So to get my motivation slowly up and running again, i’m going to work on things not such as game related for Halfling-Life, but just something a bit different.
So i ended up brainstorming the main different thing i would need for the Game, not the gameplay style, but the core game engine. Lets do this baby from scratch.
First on the list is the GUI - As you may know i find it very hard to work on a project of the interface is just a complete mess. It needs to be able to work from the start so i can add and remove things, show debug information ect so easily without much effort.
So thats what the plan is for today, the “Window” functions inside the engine class.
It will be able to create a sexy looking interface window, have parameters when initializing a new game window, for example, draggable, resizable ect. Ability to hide and show a window without actually removing it or it’s content from the game. And of course to delete the interface window thingy. I’m sure i’ll be able to think of more as i go but thats it for now!
Start of small, and slowly, i’ll get there! :)
I’m not going to bore you about all the latest troubles i’ve been having with C# and XNA due to my terrible knowledge. So i’ll get onto the good stuffs.
The new game engine is up and running, albiet to the very basic features, and no game-wise features at all.
I’m using XNA to help me out because lets face it, it is going to make my job 100x easier, and theres no point recreating it if somebody already has made it better than me. Spending way more time optimizing and developing features for it.
So far all i have managed to add is.
Engine class, this contains a “message” log sort of thing, along with a few start variables for when the engine needs them, versions, game name things and also a little function which allows me to change the game window size on the fly. Lovely!
Map Class, not much is contained in this, other than a few tester functions letting me try and work out C# fixed arrays. I’m getting the hang of it now. Sort of :).
This will eventually contain the preloader for the map (More info below on this). This will eventually be mainly used for figuring out tiles needs to be currently drawn, and other things in that area.
Tile class, this is called each time the map class wants to create a new tile, it allows to easily create a new instance of a tile, including positioning on the screen, tile information (Type?), and also the position of the image on the main tiles tileset.
Also, spent about 10 minutes putting all the tiles currently made into a single tileset.
I also googled alot of time for support on stopping textures going blurry when being enlarged (As pixel are looks terrible when blurry), in the end i could change sampler type to pointWrap, which instantly fixed my problem.
So yes, maybe i am over complicating things at the moment, especially this being a bad way of going about when learning the language, but it’s all working well. Of course i spent like 30 minutes playing around with the same bit of code just to get it to work, but at least after playing around with it, i know for next time, how to fix that problem again.
I’ve also managed to add perlin noise to the engine, this allows me to create dynamic landscapes in the game again. This was a must for me. Luckily again - Google to the rescue where someone had already created a perlin noise class. Lovely!
I’ve literally just this minute got it working, and drawn it onto a pictureBox (c# not xna), just to test how it works with live results. Success as it all works as expected. It means i get to spend days and days figuring out a great looking algorithm to generate the landscape.
I am also going tos tick with a fixed array rather than a list for the tiles as it makes sense, the map size >will< be fixed for now, so i wouldn’t need the tile array to be bigger than the map size.
And thats about it really, it’s been an exciting “first day” really, i had spent the past few days youtubing my ass off at C# tutorials and reading so many tutorials too but at the end of the day, the best way for me personally to learn a language is just to get stuck in and play around with it all - So today thats what i decided to do…
Earlier on i thought that the progress was really slow on the engine (As to be expected working in a new langauge), but looking back, writing about it all today, it’s gone quite well.. I’m impressed with myself for once :).
rapidflowstudios said: haha sorry, I got you mixed up with somebody else that I’m following. He’s making a tile-based side-scroller
Haha that’s fine, was about to say! - At first i was thinking, meh? Game Maker? nawwww - He really never just said that hehe… never really got the hang of it, alright for the right people who it will benefit it, i’m a stubborn bastard who’s stuck in his old ways of coding in Notepad++, it’s basically why i own an OS, just so i can run notepad++ haha oh god!
Little screenshot showing the recent optizations, mainly the cut off points around your screen, again - This will be widened soon, i just needed to see a few things while debugging.
Well after a while of not developing the game at all, i’m finally back onto full throttle ahead progress (sounds cool!).
Anyways - My plan a week ago or so was to get started on the Artificial Intelligence, unfortunatly this kind of hasn’t gone as planned as i thought it would of.
I thought i may as well start doing the core optimizations now - Getting as much optimization out of it as i can at the moment, and also take my time altering the tile picking algorithm to work a bit better in game.
I can happily say that both of these tasks where a great success!
It has taken me a few days to finally figure out, i was getting preeeeetty damn pissed off - Then today it just appeared in my head, the solution. I kinda hate that, but then i guess it puts an edge on programming, plus the fact that my mathematics is completely shite haha.
For the core optimization i basically had to try and figure out how i can reduce the tiles visible on screen as low as i possibly could, all the possibilities i tried where not to my liking, and i would always end up with this cropped part of the map, displayed in isometric format. So a cropped diamond. It looked terrible i have to admit, so i ploughed on to find something that didn’t feel like a slap in the face when you load it up.
It now doesn’t display in that typical “isometric” diamond cropped map, but rather fullscreen kind of, there is a slightoffset at the moment - But that’s for debug purposes of course, after i will set it so it fully fills your screen!
I’m quite happy with the result of all this and now that honestly leave me with nothing left (yet) to begin working on, other than starting the Artificial Intelligence! yaaaay.
Just to brag anyway, i managed to reduce the amount of tiles loaded at any given time from
From: 3461 (Above ground) To: 1127 (Above Ground)
From: 4500 (Below Ground) To: 3780 (Below Ground)
I think thats a big jump anyway - The perfomance is running smooth on my computer, dread to think all those entities being drawn at once on a shitty computer.
Oh well - I have an idea how i can reduce them even further, but that can wait!
So over the next few days you can expect more AI updates rather than usual terrain generation logs.
Over and out!
Don’t Worry! The development on the game hasn’t stopped completely, i’m just enjoying A Game of Dwarves more than i should, alongside finishing up a Freelance project - I can’t wait to get back into programming the game, also - I think it’s about time i come up with a name of the game too haha. Untill then, i’m afraid you’ll have to put up with some more technology crap that i post, woo!
Wow! I was definitely not expecting such an extensive response! Thank you :D but two things…1) Could you provide a link to Stefan Gustavson’s java implementation? and 2) Could you pastebin your noise() and noise3d() functions?
Hehe, one of the whole points of setting up this blog was just so i can share my experiences in game development to help others.. And unfortunatly i can’t give you a link to his implementation as i don’t know the link to it, although a bit of googling turned up this : http://staffwww.itn.liu.se/~stegu/simplexnoise/SimplexNoise.java
And some notes on how it all works http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf - I have read this before, looks familur, and what do you mean my noise functions? The noise class or my code for generating terrain?
Another update? Oh go on then…
I’ve ended up changing the transition from dirt to stone to look alot more natural, now fading from dirt to stone more slowly, in my opinion it looks better.
I’ve also added a new block type, Small Rock! Yes you’ve guessed it, yet again probably used for decoration and crafting. It looks nice! (See attatched image).
After playing around with the map sizes going really small, really large and trying on different browsers, i eventually got fed up and added a simple bit of code that automatically centers the viewport onto the center of the map.
We now have Tilepicking in the engine! Thank god, this has taken me a good while to setup, simply because for me the maths is a nightmare to do, its still a bit buggy but it works mostly as it should do, it also has support for the level height - That was a bit of a nightmare to do haha, also - For some reason, displaying one more block (the tile picking block), apparently eats away at the framerate for some reason. I’m going to have to take a look at what on earths going on, but that can wait.
In Chrome i’m still on a steady FPS of 30 :). Awesome, remember all this is being rendered in the browser, i’m really happy with the progress and what i’ve been able to ahcieve so far, just in canvas alone with this project.
Off to start with the Artificial Intelligence, adding the basic Villagers/people who wonder around in the game.
This is going to be fun! :D
Ps, feel free to ask any questions about the game!