This week I've managed to code my game so that you can pick up, move, drop , place, re-position and re-grab nodes. this is good, and I'm very pleased. the next thing I need to do is implement "power"'; in order to do this I need some visual representation, and a source. I have been working on the source, but in order to test it I need more visual cues and space to see what I'm doing (like a player really).
I've started implementing the vertical scrolling which I was talking about in previous posts, it is a little more complicated than planned because the level currently expands from the centre vertically; whereas I need it to expand from the top-downwards. After I have this working I'll probably put a simple green/red light indication of power on the outputs/hubs to indicate What parts are powered or not.
Saturday, 29 December 2012
Friday, 21 December 2012
Re-Kindling
So I spent a lot of time on Monday talking to Chris about this Project the good news is I think we both know a lot more about my project. My main issues were mainly finding the best ways to complete certain areas, and generally how to link and manage large areas of the game.
I have quite a lot of stuff written on a piece of paper reminding me of things I have to do and why I am doing them (the 'why' aspect used to be missing out until I discovered I had a list of things to do, with no knowledge of why I was doing them). I Rushed and did quite a few of the things on my list a couple of days ago in order to strike while the iron was hot, it worked and now I am a LOT further forward with my project, and a little more enthusiastic too.
'Getters & Setters'
Most of my problems originated from the fact all of my objects didn't really know where they belonged and who their parents and family were (In a non coding term). To do this I just put in LOTS of 'getters' and 'setters' which are functions which basically get or set information about each-other.
Additionally I added an array to each hub which holds all of the objects which are connected to it from other hubs (basically, INCOMING connections). Chris mentioned that I may need Incoming and Outgoing connections, but so far, just incoming seems to be doing the trick.
But what does this all mean? Well, you can now pick up an output plug and drag it around the screen; you can right click to drop it, or click on an input socket of the same colour to connect it. You cannot connect an input with an output if they are situated on the same hub.
This is a lot of progress, but I still need to implement disconnecting or re-connecting inputs and outputs; additionally I also need to further explore the colour scripting aspect of the game (very limited at the moment).
I must not forget to add a starting and end hub; it is a major part of the game which I haven't done yet - yet it will lead on to correctly sorting out power transferral.
I have quite a lot of stuff written on a piece of paper reminding me of things I have to do and why I am doing them (the 'why' aspect used to be missing out until I discovered I had a list of things to do, with no knowledge of why I was doing them). I Rushed and did quite a few of the things on my list a couple of days ago in order to strike while the iron was hot, it worked and now I am a LOT further forward with my project, and a little more enthusiastic too.
'Getters & Setters'
Most of my problems originated from the fact all of my objects didn't really know where they belonged and who their parents and family were (In a non coding term). To do this I just put in LOTS of 'getters' and 'setters' which are functions which basically get or set information about each-other.
Additionally I added an array to each hub which holds all of the objects which are connected to it from other hubs (basically, INCOMING connections). Chris mentioned that I may need Incoming and Outgoing connections, but so far, just incoming seems to be doing the trick.
But what does this all mean? Well, you can now pick up an output plug and drag it around the screen; you can right click to drop it, or click on an input socket of the same colour to connect it. You cannot connect an input with an output if they are situated on the same hub.
This is a lot of progress, but I still need to implement disconnecting or re-connecting inputs and outputs; additionally I also need to further explore the colour scripting aspect of the game (very limited at the moment).
I must not forget to add a starting and end hub; it is a major part of the game which I haven't done yet - yet it will lead on to correctly sorting out power transferral.
Friday, 14 December 2012
Logic Hurdles
I've been having a lot of trouble the past couple of weeks trying to figure out how to take the steps I need to for the next part of my dissertation and what those steps need to be. It seems the current task I'm doing is the main one which ties everything together, and is much harder and more work than I originally planned. I did have a mental plan of how I was going to go about doing this task but it seems to have been blown out of the water from closer inspections and practical attempts to complete it. Anyway, I managed to get some "clicking and dragging" going, Which is a plus point, the downside is it is a very minor part of the task, and will possibly have to be changed dramatically when I figure out how to complete the next steps. I have arranged a meeting with Chris on Monday to try and get to the bottom of this problem and hopefully get me set up for the Christmas break so I don't have any major barriers getting in the way of my tech-demo.
Meanwhile I am using my time to get further ahead in other projects while I'm having trouble with this.
Meanwhile I am using my time to get further ahead in other projects while I'm having trouble with this.
Saturday, 1 December 2012
Scrolling
I found some time to get some of the scrolling done in my game - It took a little less time than I expected actually, but overall after researching about "Delta time" (A Way of making game frame-rate independent ) it took about roughly the same amount I expected. I may not the deltatime function much in my current project, but it is A very useful steppingstone for other projects/unexpected areas.
Anyway, I added some script which allows the camera to scroll left and right when the mouse is near the edge of the screen (only if there is level content to see there though). I have an additional up and down scrolling version which is //*commented out*// just in case my game or level design needs extra height in the future (it will need some work, but it's nice to plan ahead).
While creating the scrolling, I found I needed to do another task which was add and resize the background based on the level length. I had already made some background creation code for a basic background so I just had to spend some time neatening it up, and changing it slightly so I could plug in length values. If I do decide to add additional vertical scrolling I will have to change the background code slightly, but the main thing is that I know this is possible, even if it will take a little longer than the additional up and down scrolling by itself.
I also Added a lamp to the camera. It was a spur of the moment thing, but it's quite an amazing effect as scrolling now changes the lighting and shadows of the scene. I may change this to a spotlight depending on how much range/brightness of the lighting I need.
Because I finished these tasks (and I was trying to be productive while I had the motivation), I started work on the "Activation of hubs" task. It is nowhere near finished, but basically what I did was add a check to the hubs. "If all of the inputs are active, set all of the outputs to active, otherwise, set all of the outputs to inactive". It's a simple rule, using variables that are not yet affected by anything, but it should stand strong through development.
I would show this scrolling and background but Unfortunately I don't know how to embed or link to my unity game on here (and pictures would show nothing more than last week). (if anyone knows how to do that, let me know).
My next task will most likely be the addition of plugs, and the dragging of them. I'm not entirely sure of the best way to do this (as most of my time is figuring out the best way to do something, rather than coding it) so I may ask for Chris' input at some point if I don't get a good idea.
While thinking up how to do the above, I thought about how you may eventually be able to connect a hub to itself (because I think insanely far ahead). May cause a major problem but It will give me another problem to think about overcoming eventually.
Anyway, I added some script which allows the camera to scroll left and right when the mouse is near the edge of the screen (only if there is level content to see there though). I have an additional up and down scrolling version which is //*commented out*// just in case my game or level design needs extra height in the future (it will need some work, but it's nice to plan ahead).
While creating the scrolling, I found I needed to do another task which was add and resize the background based on the level length. I had already made some background creation code for a basic background so I just had to spend some time neatening it up, and changing it slightly so I could plug in length values. If I do decide to add additional vertical scrolling I will have to change the background code slightly, but the main thing is that I know this is possible, even if it will take a little longer than the additional up and down scrolling by itself.
I also Added a lamp to the camera. It was a spur of the moment thing, but it's quite an amazing effect as scrolling now changes the lighting and shadows of the scene. I may change this to a spotlight depending on how much range/brightness of the lighting I need.
Because I finished these tasks (and I was trying to be productive while I had the motivation), I started work on the "Activation of hubs" task. It is nowhere near finished, but basically what I did was add a check to the hubs. "If all of the inputs are active, set all of the outputs to active, otherwise, set all of the outputs to inactive". It's a simple rule, using variables that are not yet affected by anything, but it should stand strong through development.
I would show this scrolling and background but Unfortunately I don't know how to embed or link to my unity game on here (and pictures would show nothing more than last week). (if anyone knows how to do that, let me know).
My next task will most likely be the addition of plugs, and the dragging of them. I'm not entirely sure of the best way to do this (as most of my time is figuring out the best way to do something, rather than coding it) so I may ask for Chris' input at some point if I don't get a good idea.
While thinking up how to do the above, I thought about how you may eventually be able to connect a hub to itself (because I think insanely far ahead). May cause a major problem but It will give me another problem to think about overcoming eventually.
Subscribe to:
Comments (Atom)