Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Waterlimon

Member Since 28 May 2011
Offline Last Active Yesterday, 03:33 PM

#5198339 Displaying fleets on the galactic map (warp)

Posted by Waterlimon on 15 December 2014 - 09:51 AM

When the fleet is stationed at a planet, the user wants the fleet associated with the planet and planet associated with the fleet:

Fleet <=> Planet

 

This is trivial by displaying them together. If you have a global list of fleets, make sure you can easily discover the planet its on and same for list of planets (again trivial).

 

When a transfer is planned, the user wants the following:

Source <=> Fleet <=> Destination

 

The source needs to be known given the fleet because the user can cancel the transfer still and this changes the state of the source as well as the destination.

 

When a transfer is in progress, the user wants to know:

Fleet <=> Destination

 

The source is irrelevant because whether the transfer exists or not is irrelevant to its state in the present and in the future because you cant cancel transfers in progress (the destination is relevant because its state will be changed when the transfer is complete)

 

So I would say that during planning, you could display something like

 

[RealPlanet (source)] -> RealFleet -> [VirtualPlanet (destination)]

near the source planet (so when you look at the source planet, you see that the real fleet that exists there is about to transfer to the destination planet (the virtualplanet could be a stylized representation of that planet, a pair of coordinates, a planet name, a button you can hover over to show the actual destination planet wherever it is...)

and

[VirtualPlanet (source)] -> VirtualFleet -> [RealPlanet (destination)]

near the destination planet to show that you have planned a transfer there, with virtual 'links' to the fleet and source planet in case you need to change something

 

During transfer you would remove the stuff near the source planet and remove the [VirtualPlanet (source)] from near the destination planet, only leaving the VirtualFleet symbol thingy.

 

Visually it could be like

 

(earth) Fleet1> -> [(Moon)]

[(earth) Fleet1>] -> (Moon)

 

looking at source (earth) and destination (moon) respectively. Basically everything that is located somewhere else is made 'virtual' (represented by [brackets] here)

 

Visually it would make sense to direct these incoming and outcoming fleet indicators such that they point toward the dest/src planet if possible, because the user probably maintains some kind of spatial map of the world in their head and uses this spatial map to remember what is going on where, so the spatial information is important in both quickly remembering where the fleet was going (without reading the details) as well as why ('oh yeah I have this massive celestial clash going on with that pirate faction in the top right corner of the universe, so this fleet must be going there') (this would allow you to even hide the source/dest details if the screen is too cluttered since the directional information should help the user remember that information to some extent)




#5198032 New steps to take to improve my programming skills

Posted by Waterlimon on 13 December 2014 - 02:21 PM

What you need is:

-API to create window and other OS interaction like I/O (win32 is lowest level youll get I guess on windows, but I suggest some nicer API to wrap the functionality so its not so ugly, like GLFW or something like SFML for simple games, SDL is popular too I think)

-Buttons and interaction with them using either some UI library, or by coding your own using a graphics API (OpenGL, DirectX) + input using the above mentioned OS interaction API

 

This is assuming C++

 

If you were to use a graphics API (or the higher level libraries like SFML, SDL) to make your own UI, you would create a window, then possibly initialize some sort of graphics device/context/whatever and use the functionality provided to draw some boxes in a loop and then do some basic programming to code the interaction based on mouse/keyboard input from some other API.

 

Dont know how you would initialize an UI library, but using one should make it much easier to input/output textual/numerical information (which is very tricky to code yourself)

 

Using C++ cross platform means that you implement OS specific code separately for each platform. Cross platform libraries do this so you dont have to (but if you dont use cross platform libraries you might have to lets say implement the same functionality using lib A for windows and lib B for mac)

You would then compile a separate executable for each platform (and the correct platform specific code will be compiled because it was set up that way).

 

I wouldnt worry about cross platform for now. Just find a library/API for your language of choice that can get buttons on the screen (+whatever APIs you need to support it) and that should be enough (Im assuming it also allows effective manipulation of those buttons through code...)




#5195407 Simulate turning radius of a car

Posted by Waterlimon on 29 November 2014 - 05:09 PM


So I am stuck what you mean by "use matrices and vectors"!?

 

You mentioned trigonometric functions so I immediately reacted by telling you to use vectors and matrices, because usually theyre enough.

 

I believe you would somehow multiply the car matrix with another matrix that has been offset and then rotated... I usually think about matrices in terms of working in the 'object space' of an entity and then moving the matrices from object to world space and the other way. So first youd calculate the object space rotation matrix for turning the car about a point (left/right of rear axel), then do something like carMatrix.toWorldSpace(localMatrix) to find the new matrix for the car.

 

I tend to use quite a lot of trial and error because im not that familiar working with matrices and get the order wrong...




#5184967 n-dimensional noise generation

Posted by Waterlimon on 04 October 2014 - 10:00 AM

You could also try to do it by setting the seed of the RNG. For example, you could use the hash function given by Alvaro to set the seed (the default_random_engine seems to have a method to set it)

 

Using something simple like x*width + y might work fine too. (you can combine this with another value which is the same for the entire map or texture, this would be the seed of your map/texture)

 

This means that after setting the seed, youll get the same exact sequence of numbers every time. This is useful if you need more than one random number per coordinate. So instead of a single random number that is the same every time, you can get as many as you want and theyll be the same every time.

 

Im not sure if this has performance implications or if it causes issues with the distribution of the random numbers generated.

 

Something like:

void genStuff(x,y)
{
    gen.seed(hash(x,y))
    for 1 to 100
    {
        float random=line(gen)
        *Do fancy generation logic using random*
    }
}



#5184964 Should i prioritize CPU or Memory usage?

Posted by Waterlimon on 04 October 2014 - 09:47 AM

What you want is for your program to work as intended and not have any negative effects on the system.

 

Too high CPU/GPU use means it doesnt work. Too high memory use means it doesnt work.

 

But thats not all. You also need to take into account the context. If your program uses all of the RAM, it might work, but what if the user wants to run another program too? What if the user has a different amount of RAM than another user? What if the user doesnt want your program to constantly use the HDD because it wears it out or prevents the user from doing video capture or whatever? What if the user has a laptop and too much processing makes the battery run out fast or forms too much heat?

 

So for your map loading example, you want to make it adjustable. Youre probably not on a console, so every user and their machine is different. Thats why we have graphics options in practically all games (and a lot of them).

 

For the stuff that doesnt make sense to be adjustable, you need to predict what kind of resources the application will use and how much, and try to balance it all out so that nothing ends up being a huge issue.

 

Generally this is easy, since one of the approaches is usually easier than the others, so you can just use that one and come back to it later if required. If the approaches are vastly different in every aspect, it is more difficult since choosing the wrong one could be a complete waste of time (since you might need to reimplement the whole thing, not just make a small addition or tweak). For those situations you just need to have experience and know your projects requirements and make an educated guess.




#5184534 Funniest line of code ever ?

Posted by Waterlimon on 02 October 2014 - 04:12 AM

I would much prefer the use of arrays instead of separate variables for the animations, because there IS a mathematical relationship between them, and using separate variables hides that knowledge from the compiler.

 

ANIM* runAnims[4];

ANIM* idleAnims[4];

 

The same thing bugs me with many other things like vectors of all types, whatever they represent. If an array of variables isnt represented as an array or equivalent, theres bound to be repetition.

 

Though here something that mapped a direction vector to an animation would be nicer. But that is easy to implement by providing a unitDirectionToArrayIndex(vector<2> dir) helper function.




#5183720 Making a shot harder to pull off.

Posted by Waterlimon on 29 September 2014 - 07:06 AM

Do something funny like making the players weapon jam every time he is about to get a heartshot in a situation where you dont deem it acceptable.

 

Or change the game design on a larger scale to not make it such a problem.

 

Or add some random element to make it not successful most of the time (your arm is shaking and the gun is shaking all by itself and the bullet is shaking while flying because turbulence and the enemy is shaking while trying to avoid being hit and the heart is rapidly shifting position because adrenaline).




#5183702 ROBLOX/Other Games Programming(Lua)

Posted by Waterlimon on 29 September 2014 - 04:54 AM

Used to play roblox, now just use their forums as a tool of procrastination.

 

 

 


I actually came here to ask for some useful sites or tips to get me started. Yes I want to use Lua for more games, not just ROBLOX. I do have a semi good understanding of Lua, I just need some extra assistance. 

 

Ive seen many people go for the Lua based game engine LÖVE.

 

It seems to be limited to 2D, but has all the things a game engine should have (hardware accelerated sprite rendering with shaders, physics, threading, networking, bunch of utilities...)

It also seems possible to use LuaJIT (not sure if its enabled by default) so I guess it will also be faster than roblox for the Lua-side code.

 

So you could use that.

 

 

You should also learn at least the basics of some other language (probably C#, C++ or Java) simply because they are so popular and if you understand them, you will gain a better understanding of how any programming language (including Lua) works in general. For example you could just read through some C++ online tutorial to the point where you know what pointers are and make some silly console application.

 

Another thing that might be useful is to check the official Lua documentation. Especially the reference manual, since it seems to offer a good explanation of the workings of Lua (since as a dynamic scripting language there is some magic going on to map the Lua script to how the computer works at a low level).

 

And of course, keep googling and reading about things you want to do in whatever game you are working on, be it the general structure of your code, some GUI design issue or a difficult decision of how to implement jumping.

 

You still might find that you want to keep scripting in roblox because you get free hosting and a lot more publicity for your stuff than if you make an independent game (unless you are serious about it and are able to gather a community of your own around it).




#5181893 simple crafting system

Posted by Waterlimon on 21 September 2014 - 09:20 AM

I have always disliked crafting system where you supposedly have to discover a recipe to use it (=look it up on the wiki because theres no logic to the crafting ingredients required to make something)

 

So I personally would prefer a very transparent crafting system. Basically an ingame list of all craftable items, structured logically. And highlight items you might want to craft (relevant to current situation), AND items you can craft or almost can craft (you have the ingredients in inventory).




#5181767 Point based physics engine

Posted by Waterlimon on 20 September 2014 - 02:18 PM

Ok I see, so you want basically a grid based (3D) game with physics?

 

What I was thinking is that give each 'point' a float position to make the physics smooth.

 

However, you could still have the physics rely on the grid cells - a point may only interact with neighboring grid cells.

 

 

I did something similar for a 2D grid game, because I wanted the player to be able to stand anywhere, not just at the center of a grid cell. But the collision detection still worked based on grid cells (the player was 1 grid cell sized square)

 

 

What I did was to have a normal grid for the world (you know, grass in this cell, stone here etc.)

And each moving entity had:

-Float position, velocity

-Integer position (grid position)

And the physics applied velocity to the float position, which was rounded to get the grid position (so it can find neighbor cells to do collision detection, like if in a cell above ground, limit the float position from going too low into the ground).




#5181753 Point based physics engine

Posted by Waterlimon on 20 September 2014 - 12:58 PM

Were you perhaps thinking of simulating it more like fluid physics, where the points interact with each other through forces based on distance? Like atoms and other realistic thingys.

 

Since that would give them such an 'extent' (although blurry) of sorts.

 

If all the points had a limited radius of influence, you could use a hash map or a grid to do the physics in O(N) (since for each point, you only have a fixed number of surrounding grid cells to check, and only a very limited number of other points can fit in those cells) I think... :|

 

It would be almost equal to having integer coords and only interacting with points in adjacent coords. Just a bit more detail.




#5177172 Collision detection against curves or other complex shapes and bitmaps.

Posted by Waterlimon on 31 August 2014 - 04:07 AM

You would either represent it as a collection of simple collision primitives (circles, boxes etc.) that are scaled and rotated to approximate it well, or you would approximate it as an arbitrary polygon (which the physics engine could triangulate or just do physics based on the polygon edges or whatever works the best)

 

Check some 2D physics engine and see what features it has.




#5175848 MMO Gap issue

Posted by Waterlimon on 24 August 2014 - 12:14 PM

Progress is measured by how close you get to a goal (which may be infinitely far away but whatever)

 

Change the goal over time so newcomers will not be pursuing the same goal as the veterans.

 

This can be implemented as starting a new world every once in a while (or expanding the world and putting new players in the new regions), but you could come up with something that works in a single world/place. Like a new branch of magic to pursue that is slightly better than the old one when people start getting too good at the old one.

 

It might make the game remain interesting for longer for the older players too as they have to keep 'adapting'. Or it might just annoy them when their work becomes less and less worthy if they cling to it.




#5173327 Is it possible that I just simply lack the required intelligence?

Posted by Waterlimon on 13 August 2014 - 07:07 AM

Also, when you find mistakes in your code, think if theres anything you can change in the way you code stuff to avoid similar mistakes in the future.
The whole point of many language features and coding practises is to prevention bugs and keep everything simple, so focus on that.


#5169512 What happened to Rastertek?

Posted by Waterlimon on 27 July 2014 - 09:29 AM

http://web.archive.org/web/20140625035927/http://rastertek.com/

 

seems to have the tutorials there, dont know if you can download the files though.






PARTNERS