Showing posts with label rpg game project. Show all posts
Showing posts with label rpg game project. Show all posts

Sunday, May 9, 2010

Design update !!

Hey, I told you all that I would take my time and post something eventually. Well now is the time !

I have been working on the way my main form looks like. I had a few problems: 
First I wanted to get rid of the ugly conversation panel I have. The idea of a form popping whenever you talk to someone is crap, and having to close it again and again is a pain sometimes. I wanted to have some kind of control that would show messages for me. I have recently learned to make my own custom controls and found the idea of having a portable "messages & communication" box quite good. And here is the control and the code: 

The images speaks for themselves. The messagebar has a sub named addMSG() used to send messages to the textbox. The textbox is readonly to prevent the user disturbing the text and because the keys I use to move are the arrow keys I have made a sub to replace the caret (the little horizontal line standing where you clicked) every time a key is pressed. That way you cannot scroll through the textbox inadvertently when moving, only with the scroll bar. 

I have also begun to look into the code involved in moving around. The same 4 subs ( one for each direction) are both used to move and initiate a transition and I think this is a flawed way of getting around since the complexity is very case-by-case and thus need a lot of if's to verify stupid stuff. Due to the complexity of the overhaul this could take some time but I am still working on other parts while I'm digging around for a better solution. 

I have downloaded some tiles on a website because I don't really have *that* much time on my hand for designing .jpegs, time that could be better used somewhere else. They look good and I plan to make use of them someday to showoff a better version of the game. 

The game now looks thus: 



As you see I have made some subs to handle conversation. Now every sprite has an NPC class that is used to store conversation and other relevant stuff. I'll explain it in a later post. On this note see you all at the next post !


Wednesday, March 24, 2010

Update !

Hello, I've been working a lot on the project these days. I have implemented transitions between maps ( will make a post about that piece of code soon, I'm still working on the "Un-escapable loop" post ), and I have arrived at a point where my system began to be messy and unorganized. I have began to code a massive overhaul regarding my arrays. I can't just let them sit at the top of my class. Because of my goal of having at least 30 minutes pf content, I will probably have to make a lot of individual maps. Outside maps, indoor, inside dungeons etc. And triple that because I need to add a sprites_map and a transition_map to each of them. That could mean a couple hundred of arrays just sitting there waiting to be used.

My idea is that I would make individual text files containing the maps ( single map per file or a single big file with all maps, I don't know yet. Or even an XML file on the condition that I re-read on the subject). I now have to make a class and get the I/O working well. Every time you move to the edge of the map over a transitional tile, the matrix will change its tileset and put you in place. This is particularly rough part on me and I need to read a lot of stuff and my post count will probably drop a bit. I will try to keep you all entertained ( all two of you reading my site ). even though I'm busy as hell.

Keep looking over my GitHub page, frequent updates are to be found. For those who forgot the link, check my pages.


EDIT 10:32 24/03/10 :
I have nearly finished the overhaul I was talking about. It is a MAJOR change throughout the project. If I was to explain everything I'd have enough material for 2 weeks. Prepare for some big posts later in the week or the next.

Friday, March 19, 2010

I love the smell of burning CPU in the evening, smells almost like... Victory

Oh yes ladies and gentlemen. I have now a playable version of my game, its not much. But it is the content of all I've been doing these past 2 weeks. You can browse the code here and download an executable from this page.

And I DID solve my Un-Escapable loop problem, I'm going to make a port on this one. 


Milestone 2


After hitting more walls in my previous version of the program I decided to create another form where I would put only the code I need. To make it cleaner and more manageable. It is currently at its third iteration. But while I was looking at my code ( which was muuuch easier to read in a clean environment not chuck full of properties and classes anywhere) I though of the following logistic: I have two matrices, two arrays and 3 methods to help me put those on the form. If I followed my plan to make another matrix for the game hero, I'd have even more. So why not make it only 2 methods, one to fill the matrices, and one to show them. Simple since they do pretty much the same. And to that conclustion I said, why not have a single matrix ? Why would I need 2 layers when I could easily do it with one, and actually make this a lot more simpler and easy. The final result is that I have a single matrix of pictureboxes and two arrays with two methods to fill and stamp it. 


This is the code I used. you can see this all the simpler. 


The loop problem was caused by this: from the moment I decided to use an matrix of pictureboxes instead of images I changed from a type to an object. Do when typing 


Dim tileMatrix(15, 15) as Picturebox


What it did was to create 256 pictureboxes that are actually the SAME picturebox. Because there is no New()   I will create a subsequent post explaining this particular error but for now do understand that the problem was that every picturebox in my matrix was the same picturebox. It was a single one with 256 references through the matrix.