ladbon

There was one and there was no one

Month: March, 2014

Last HUD Improvement.

This week for me is writing the stats HUD in customize. This is where you read all Arianas stats and current score when you are in customize menu. 

It was simple here cause I was only working with one class: CustomizeState.h/cpp. I created the formula which had to keep checking which current weapon you have to write the name so a integer Current_Truck; and just pepper it in our if’s that check whenever you press upgrade. A pretty simple task really. Unless something was broken before you noticed was. The last truck upgrade didn’t take any score and I just realized that. 

Question: Solution? Answer: I changed around the button check and current truck if’s in the button loop parametres.

I guess this week have been about many other things. it’s possible my productive capability isn’t on par with past weeks.

Now working on a menial task and don’t want to go overboard with balancing I had some fun with naming stuff as well!

 

Now working in this order I now always try to find a meaning that’s relevant with the game, especially a way to interact with the player and the designer similar to  “I know how you are feeling =)”. I started naming all her suits honorable titles, her weapons as nerf gun nicknames and her truck for

 

 

 

 

Frankly it wasn’t all that dramatic this week. I will blog next week about my balancing as a final blog post of what I’ve done and start my report writing =)

 

Image

 

I want to be the best

This weeks artifact have been high score.

Our game is nearing it’s end stage and we are moving into a full feature freeze and going into balancing soon. Our group have almost finished a survival wave based top down shooter called at the moment -something something road-. You take control of a young woman named Ariana. A traveling saleswoman that have to defend herself from bandits during trips. Set in a spaghetti western steam punk world near India she defends from waves of enemies that try to destroy the only worthy possession she has, her truck. You bulk up in score by killing enemies and use it to purchase yourself upgrades for either speed, new weapons or hp. These will affect Ariana in different ways and how you play her. It’s main objective isn’t to survive the hoard of enemies, it’s to get the highest score but buying upgrades for an easier completing makes it hard to reach a higher one as you lose a fixed amount of score upgrading.

The dynamic we wanted to reach was imperative as the simple goal of completing the game will be a lot easier rather than reaching the best score possible. One mechanic that do set us apart is our main controls. We wanted to find a easy way to defend a circular central point on your screen so we made the controls fit the circular collision box that is your truck so when you move you strafe in a 45 angle creating a smaller circle that encompass your truck. It’s creates some difficult navigating at first but when you get the feeling of it the advantages are great.It’s inspired from the circular cities built during the middle ages for easier defending it from sieges. It worked then and it does here. One thing we added this week is some kind of gravity pull for the only power-up in the game, a toolbox which essentially fills up your hp by repairing the truck.

I guess the only thing I haven’t mentioned now about the game is that you are immortal, you can never die unless your truck gets destroyed as it’s power source operates there. No bullet can harm you, sound easy right? wrong hehehe. We will begin the betastage tomorrow.

HERE IS THE ARTIFACT THE REST IS COMPLETELY FOR MY REPORT AND THOSE INTERESTED ENOUGH TO LISTEN

I’ve been working on high score for quite some time now, it’s been brewing on my mind how to build it and what to expect from it when you play the game. It’s not fully functional as some bugs occur like text written over text(might be fixed this hour though).

I had a picture that you create a class that has 4 main methods, Save(), Load(), Read(), Arrange() with  two different dynamic vectors of information. One for keeping track of score and one for keeping track of names. I wasn’t sure about what stream I would be using cause the benefits wasn’t familiar. I had never actually worked on this you see, it’s completely new and when something I need to pick it apart and play with it. Almost a week and a half goes by without any results. I wasn’t getting any code done and the research wasn’t going well. I had to get a meeting with my superiors to understand what I am dealing with. The meeting went and I became much clearer. My design was very on-line based and complex according to my teacher. I was thinking of some kind o racing game high score so I was taught a more suited design.

My design became struct based objects that keeps track of name, score and kills. They are then pushed back into a dynamic vector that keeps track of them. The main methods are Load(), Save() and Arrange(). There are some other methods which are only there to retrieve a single object and one to get the size of the vector.

I create a txt file that already have a few scores in them which at the moment of the startup I load in the scores which are handled by a loop, string stream and a struct. They are then sent out to be arranged so when you start up the program you are allowed to see your high score immediately. It’s then changed when you have lost/won the game. Here you get to write your name and press a button to submit your name, score and kills. The score and kills are already taken care of in the game object manager but I needed here to get the name. I must tell you it took a good three days to get this right.

The method was a event.type in SFML called TextEntered. It’s designed to register every button on the ASCII table you press and all you have to do is create a sf::Text object to place it in there with a string stream and you’re done. It wasn’t easy to get this figured out and working as I wanted mainly because of my inexperience I guess but good comrades are always there fortunately.  So when you press submit your struct object with your name, score and kills goes into the dynamic vector and arranged accordingly. In the same menu you can now press high score(could have before but you wouldn’t have gotten your high score submitted!) and behold, a list of names, arranged perfectly. When you press back from the high score it saves the information that it stored locally in the program back to the txt file which it erases first to make sure stuff don’t get overwritten.

I had a few issues going into this new ideal. My main crunch method is to create the class, the methods and connect everything before I even start to draw stuff out which I haven’t found to be an effective way to code so when every single line of code was finished I couldn’t draw it out, my arranged method wasn’t working and I was creating line breaks and spaces where I didn’t want to. It took me a while but when these minor issues were solved with a reversal of the arranged method and taking out the line breaks and spaces I could now arrange it accordingly in the txt file. The biggest problem I faced was that it drew only the highest score and that’s it. I struggled with this last night and all of today. I build my draw method into my high score state which keeps the highs core class object locally to simply get the whole vector of scores one object at a time. I then push them back to a sf::Text object and place them in a sf::Text vector of it’s own. These are then iterated and drawn out …but it wasn’t drawing. I took the iteration where I get the struct objects to the initiate method instead of the update but it still wouldn’t do it. I finally found the issue, they was getting drawn just not with a font, color, position and style! I was renewing my sf::Text object at the end of the turn but kept the options I put outside the iteration so it wasn’t creating new ones. When I finally put it in there everything worked out correctly. I just need to fix the bugs and it’s all done!

Screenshot 2014-03-14 11.50.20

Sorry for the WALL OF TEXT but hey, it’s nice to get this all out,
Cheers.

Animation in my nation

So another week has past, another artifact accomplished and perfected. A new thing has been learned this week. animations.

if you haven’t been paying attention in school I guess I’ll go over the basics.
You create a class that allows itself to have a string of pictures.
These depicts an animation and you line them up perfectly and in order.
You take all of these images and load them into the program as just ONE image.
You then created small frames of where you want to look at this specific time and for how long of a duration on this ONE image.
finish it off by putting in more and more methods of genius into the class
like pausing.

So I probably understood what I was doing with animations about two days ago.
It’s like one of those days you fit every puzzle in your brain and understand every step you just took when seconds before you were a nerve wreaking moron just typing away until stuff showed up.

So each object of animation I create need to have a few details included before I could actually use them.
The program loads a sprite for lets say an enemy, when inside the enemy class I create an Animation Object and send the sprite I just loaded, a float duration for each frame and two booleans(if paused and if looped) with it as a parameter.

When this is done I call to a method inside the animation called AddFrame that point a rectangle you create that’s fitting for you enemy and you just point it where you want a frame to be. It’s that simple hehehe…

I wont lie, it took a senior, one of the smartest guys in class and a week to figure all this crap out. I’ve been playing around with it since and finally gotten everything in order now.
I apparently didn’t understand the concept of setOrigin that SFML has and had way to much to think about. There have been a few changes in the group that wasn’t planned and we’ve made some cuts. It’s not been great but this week have really been an eye opener. If anything I see now that this is something that I really want to do.
I have been having is creating my high score class which I WONT be talking about anytime soon.
As a bonus I created some kind of score feedback(pictures will come soon, on the wrong comp) which will be our picture for this weeks post.
I tried to keep this one short so thanks for reading and cheers.

 

TruckLvl2SpriteSheet