Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


ncsu121978

Member Since 29 May 2000
Offline Last Active Today, 12:30 AM

Topics I've Started

prevention of loops in transfer of [consumable] between game entities

12 November 2014 - 11:34 AM

11huhkn.jpg

Question:  I have energy producers, energy storage, and energy consumers connected together by links as in the picture.  I can have a vast number of these but this is enough to illustrate my issue.  I am trying to work out how exactly to distribute the energy.  The producers will produce at set intervals and has no storage capability.  The storage can take energy from the producers and store it and can also send energy to consumers or other energy storage.  The user just takes energy and produces some action with it.

 

I have thought of two ways to approach it.

 

Method 1 - If the element is a user OR storage, then it will look at each other element it is connected to.  If that other element is a producer or storage then it will attempt to take energy from it  If it is a producer it does nothing in this method (but produce energy at a set rate and will then have it available to be taken).

 

Method 2 - If the element is a producer OR storage, then it will look at each other element it is connected to.  If that other element is a user or storage then it will attempt to give it energy.  The user does nothing but when it detect it now has energy it will do something with it.

 

So it is a choice between a push and a pull.  The problem lies between the two storage connected to each other.  In either method they take away from each other with a net transfer of 0.  And I dont think I can just do a detect that if I am a storage and the other is a storage then don't transfer anything.  That wouldnt work if the link between the left storage and the producer didnt exist because then further down the chain that left storage and the end user would never get energy from the right storage if I didnt allow storage to storage transfer.

 

Gets more complicated if say there were 3 storage connected in a triangle linkage with one of them connected to a producer.

 

So any ideas on how to do the energy transfer without getting it stuck in a loop?


movement as in Steam Birds

24 October 2014 - 12:07 PM

I am working on a game that I want to have movement similar to what Steam Birds use if you are familiar with that game.  If you are familiar with it you can skip the next little description for the uninitiated.
 
The game will start off paused.  You are able to select the direction you want your plane to move (and what "special powers" you want to use during the next turn but that isnt important to my question).  Once you have selected your movement then you click a "Go Button" and your movement and actions are carried out in 4-6 seconds of play where you have no input.  The game will then pause again and wait for your input....wash rinse repeat.
 
I would like to implement the movement selection in my game.  Your ability to move is restricted by your current speed and direction meaning you cant instantaneously move the opposite direction you were just moving last turn.
 
Below is a picture of a path selected for a plane in that game
 
How would I go about allowing this path selection?

NVIDIA OpenGL driver issue?

05 April 2013 - 07:33 AM

I am beginning to wonder if there is an issue with the OpenGL drivers from Nvidia on Windows 7. I do my normal programming on my laptop with a GTX 560M graphics card. I do have an external monitor plugged into my laptop and utilize both screens as an extended display setup. But the problem persists even when not using the external monitor.

I coded up a super simple program in C# using SFML2.NET with Visual Studio 2012. All it does is create a RenderWindow and move a RectangleShape across the screen and when it gets to the far right then moves it back to the left to repeat. If I run this in fullscreen mode then I have no issues. When I run this in windowed mode I get a strange graphical glitches. About 2-3 times per second (about every 20 or so frames since I run at 60FPS with vsync) then my image for a brief moment jumps backwards as if it were drawn where it was 10-15 frames ago, and then immediately jumps back to where it is supposed to be. Its as if for one frame, it is still drawing a frame from 15 frames ago instead of the current one.

I recreated the same exact program but in C++ with SFML2 using Visual Studio 2012 and has the same results. It is OK in fullscreen but has the issue in windowed mode.

I then recreated the same program in C++ except utilizing DirectX and there is no problems in Windowed mode or fullscreen.

I then recreated the same program in C++ with SFML2 on Ubuntu using the gcc compiler and Code::Blocks. It has no issue in windowed or fullscreen.

So it seems to me there is some kind of OpenGL driver issue on Nvidia in Windows 7. It could just be a bug in the Windows version of SFML2 before it even makes the call to OpenGL. I am going to code just straight to OpenGL instead of going through SFML to see if the problem still repeats itself.

I know this isnt any kind of physics or math issue on my part for the positioning as all I do each frame is do a +2 to the rectangle shapes x position every frame for this test.

Also put a breakpoint in to a conditional statement that if the x position is ever smaller than it was the last frame then it would hit the breakpoint and I could see it. I did make the exception that the breakpoint wouldnt trigger if it is when i manually set the x position to 0 while doing the screen wrap. This would let me detect if something was screwy with the simple math but it never hits the breakpoint saying that the x position is smaller than it was the last frame.

Anyone else have issues like this?

[Edit]Appologies for the formatting of this text. My work computer doesnt display this website correctly and isnt letting me put breaks in the text

recommendations for multiplayer roguelike battle system

09 October 2012 - 06:21 AM

I want to see what people would think is a good system to handle a multiplayer roguelike. Specifically the aspects of movement and battle. Here are a few options I came up with

1 – Allow player movement on the map as fast as they can mash the key to move (at least as fast as the server recognizes). The mobs on the map will move every update of 1 second (configurable). The mobs on the map will be like in Ultima 3 for the NES. If you and a mob occupy the same tile, then it will start an instanced battle that is completely turn-based like a normal roguelike. You will be put onto a battle map and will fight the mob/other player there. That way back on the normal map, other players can keep moving and the map mobs will keep moving/updating at its one second interval. Other players will see you on the map, but with some type of icon denoting the fact you are in an instanced battle.

2 – Allow player movement on the map as fast as they can mash the key to move. The mobs on the map will move every update of 1 second (configurable). However, battles are NOT instanced. If you agro a mob (or other player) or in some way become hostile (engage in combat) with a mob or other player, then you then step into an update pattern of say 1 updated every 2 seconds (configurable). Where you and the hostile mobs (players) select an action that will be performed on every update tick. If you didn’t select an action in time, then you don’t do anything that tick (or maybe an auto action such as auto-attack). Other players/mobs who are not involved in the battle (aggroed or hostile to you), then they keep moving as though nothing is going on. They can see you in battle on the map, but aren’t restricted to the update per tick because they haven’t aggroed or become hostile. Players keep moving as fast as they can mash the button, and other map mobs move at 1 update per second tick.

3 – Recommend to me something else.

semi-realtime roguelike battlesystem

18 September 2011 - 06:14 AM

so i am trying to make a roguelike with a large wilderness area. I do not want it to be completely turn based as even if the player is not moving around i want the mobs and other things in the game environment to still move or do the things they do. Say every one second all entities are able to perform an action, in the case of the player he may just be standing doing nothing and may miss his opportunity to act but it wont stop the rest of the world from acting.


Now how do i turn this into a battlesystem? I was thinking that if the player had their "action" key or whatever it is they want to do pressed when there "one second" opportuniy hits, it will perform that action. But that could cause a delay up to a full second between pressing a key and the action taking place. Also if the action is just a movement key, waiting a full second to move each tile would cause a lot of pain if trying to move to otherside of world (game world will be at minimum 256x256 and bigger).


any other suggestions?

PARTNERS