Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!


Member Since 03 Sep 2008
Offline Last Active Aug 10 2015 01:12 AM

#5232457 An unsual idea for a casual MMORTS

Posted by SillyCow on 02 June 2015 - 02:26 PM

 it closed down because it became boring after building your army (and some buildings) for the 50th time.

That's why the building part is separate and persistant. You build your lander (base)  and landing crew (army) in orbit, and recycle it throughout the game.




You could even further extend this by allowing ground players to offer bounty on ground targets for reward, this could be balanced by saying there is some kind of governing body who adds funds to the bounty of weaker players.

That's a cool idea. I could also add some AI players that add a bounty on the strong players. That way there is always motivation to attack the bigger players. Maybe something like ransom: You "kidnap" an enemy unit, and demand a ransom for it. The strong player is handicapped until the ransom is paid (or until he kills you). Anyhow, a mechanic that adds motivation for attacking strong players sounds good.

#5232233 An unsual idea for a casual MMORTS

Posted by SillyCow on 01 June 2015 - 03:22 PM

I had a cool idea for an MMORTS.

I had a look at " Curiosity – What's Inside the Cube". The game was not that fun, but it had one element which really got me:

It was a "near real time" game (RT)

A single persistent map that everyone can play on simultaneously. (MMO)

But... No waiting rooms, no lost matches upon disconnect. You just turn the game on and play (Casual)


I thought about how I could go about applying these mechanics to a more serious, and more interesting game. A casual MMORTS game, that you could just turn on and play when you have 5 minutes.


Let's ignore the MMO-engeneering technical difficulties. (I have some cool cloud algorithms I'm aching to try)


Game Setting:

Imagine a setting similar to Dune. There is a single giant planet map. The planet holds a rare resource that everyone wants.



Each player starts out orbiting the planet. At this pre-mission stage they can build their lander and landing crew.

The lander is a giant vehicle, that serves as a base.

The landing crew are your units.

Once you are ready to land, you can view an overview map of the planet. On this map resources show up spontaneously every once in a while. (Meteor strikes/ Volcanic eruptions, etc...). The map is a giant zommable map of the entire world (sort of like google maps). You pick an area where there are some resources and you land. You can see other players who have landed, and you can chose a good spot: One that has lots of resources, or one that doesn't have many adversaries.


MMO Planet surface:

Once you land on the surface, you get your crew to mine the resource, and carry it back to your lander. Of course, there are other players in your area, and they can steal resources from your harvester units by destroying them. So you have to protect them using fighters. Your objective is to get the resources to your lander and take off. The server will make sure there are less resources than players, in order to force conflicts to happen. example: If there are 700 players on the suface, there will only bee 200 resource-meteor strikes at a time. Thus forcing everyone to fight
If for some reason you disconnect, your units will automatically return to your lander and take off. As such, a disconnection is not very harmful.
The building stage (oufiting your lander) takes place in orbit in non-real time. So a disconnect will not set you back. In fact you can purchase a new unit for your lander when you have 2 minutes between classes, but only play the mission in the afternoon.
Space on your lander is limitted. This will prevent players from getting too powerful to fight. Advanced players will be considered advanced by the total amount of resources that they have harvested. Not necessary by single army strength. Perhaps a strong army will require a large upkeep, causing the army to "decay".
Since everyone is connected (hopefully without needing to register), it would be nice to experiment with some innovative social stuff. Example: Find a game mechanic to encourage co-located users (through ip-trace or GPS) to land on the same areas of the map. That way, if there are two random players riding on the same real world bus, there is a good chance that they will fight eachother (or team up). All done transparently though...

That's the basic idea. (I have some cool algorithms about distributed quadtrees, to dynamically host the planet's surface)

What do you guys think?

Also, I'd like to know if you know of anything similar which has been done before?

#5193523 Java - Maximum Recommended Threads At One Time ?

Posted by SillyCow on 18 November 2014 - 04:31 PM

Most answers are ignoring the word  "JAVA" in the title. Java has executors. If you want to use alot of threads, use a threadpool executor( or possibly a "stream" if you are using java 8).


Those are nice ways to obscure the fact that you are using threads. If you can subdivide whatever it you are doing into a bunch of short tasks, you can let the system manage how many threads you are using.


Since you are looking to "wait" for timers, may I suggest you use:

1. A timer thread: To push events into the executor. (don't actually run them, just schedule them to run later in the executor)

2. A threadpool executor: To execute the events.


Then you can play with the treadpool size. Notice that the timer thread is not bogged down, because it is not doing any real work.


All of these classes are supplied with Java. You don't have to write anything yourself

#5193304 Polygonzing a mesh

Posted by SillyCow on 17 November 2014 - 02:53 PM

You are right. I was a bit sloppy in my description.

1. I wrote convex, but meant concave. You can see a Concave polygon in the example set.

2. There are no floating verticies, or floating edges for that matter. (no holes are allowed either, so no islands exist)

3. There are no duplicate verticies. (I run a preprocessing step and "weld" all vertices within a threshold).

4. No two edges overlap. (I run a preprocessing step and split all overlapping edges). 

5. All of the lines in the example above, including the borders, and the diagonals that you see are created by the artist


So the vertices are not random with regard to the edges. They are related in that every vertex is part of an edge. And if the artist draws two colliding edges, a vertex is automatically inserted at the intersection and the edges are split along it.

#5116924 Many to one relation in an SQLite database

Posted by SillyCow on 14 December 2013 - 01:57 PM

select * from Class where Race like '%Elf%';

This has terrible performance. It is an unindexed query. This means that you are reading your entire table every time you retrieve a line.


If you ever want to make the "who is an elf" query, you should definetly normalize your database.

#5104892 Where can I learn software engineering, for free?

Posted by SillyCow on 27 October 2013 - 05:27 PM

How much do you already know?

Do you know the basics: MVC, etc...?

#5101648 Transfer (Trade) System?

Posted by SillyCow on 15 October 2013 - 03:31 PM

Learn about the standard library containers,

Specifically, look for a tutorial on "STL maps" to get started.

Then learn about the rest of stl.

#5100851 Trying to simulate the flamethrower from GTA2

Posted by SillyCow on 12 October 2013 - 01:30 PM

Do you mean that the near part of the flame in GTA is straighter, then the far part of the flame?


If so, make your flame decelerate as it get farther from your gun.


I will assume you are currently multiplying your flame's direction by the time elapsed.

Change it so that the more time elapsed, the farther & slower your flame should be.


instead of multiplying by time, multiply by some root of time.


Instead of: 

Position = FlameDirection * Time

Do either:

Position = FlameDirection * sqrt(Time)


Position = FlameDirection * Math.pow( Time , float_number_smaller_than_one)

The smaller float_number_smaller_than_one is, the more "bending" you will have.

#5097552 space wars

Posted by SillyCow on 28 September 2013 - 11:26 PM

Switch the order of your rotate and translate.

When you want to rotate an object on it's axis, rotation should come first.

However, since openGL transforms are a stack, what happens first is what is closest to the code.

So the order of transforms of opengl is actually resversed.


This is kind of confusing at first, but is really logical when you need heirerchial animations (like a skeleton). It's also required because of the linear-algebra behind openGL.


So what you should be doing is:

void DrawShip(GLfloat position_X,GLfloat position_Y, GLfloat position_Z, GLfloat rotation,GLfloat color)
glTranslatef(position_X,position_Y,position_Z); //move only after the ship is rotated.
glRotatef(rotation,0.0f,0.0f,1.0f); //Now rotation will happen before movement
glBegin(GL_LINE_LOOP);glVertex3f(0.0f,-0.25f+position_Y,0.0f); glVertex3f(-0.25f,-0.5f+position_Y,0.0f); glVertex3f(-0.5f,-0.5f+position_Y,0.0f); glVertex3f(-0.0f,0.5f+position_Y,0.0f);

#5097494 3 Questions on my mind about (winsock)

Posted by SillyCow on 28 September 2013 - 03:18 PM

1. Yes identify your clients. Usually a server has more than one game at a time. So besides "not mirroring client 1 back to itself", it's also about "not sending client 3 which is in another game" back to clients 1 and 2.


2. You can use asynchronous io. Look up TCP IO selector on google. It can handle many connections on a single thread. The problem is that It is more difficult then using threads, so if you only have less then 10 connections at a time, don't think about it and keep using threads.


3. Some people like to use UDP instead of TCP for multiplayer. It is much faster than TCP, and you can also broadcast to more than one player at a time. The problem is UDP packets can arrive out of order, so you need to re-order them. If you are using TCP, don't worry about it. TCP is basically a high level protocol over UDP that includes ordering and error handling. If you are making a realtime game, I would turn on TCP_NODELAY to prevent TCP from delaying transmission of your data. These delays can reach several 100s of milliseconds.

#5095280 Trouble getting a stable framerate (C++/Allegro 4)

Posted by SillyCow on 19 September 2013 - 04:22 PM

limit your speed to a sliding window:

1. Keep a sliding window (queue) of your last 50 frames' times (or any other number)

2. If your current frame is too far ahead of it's time: You want 50 FPS, but a second has not passed since the last 50 frames, then sleep a little bit.

3. You will also want to check the last 2 frames, to set an upper bound for speed: It is ok for the game to accelerate to compensate for missed frames, but there should be a limit on the maximum rate. If you do not do this, and you have some long frames, then your game will jitter.


Regardless of these points, you should separate your logic code from your render code. Your logic should never fall behind as a result of frame drawing speed. If you use a single thread it should look something like this.

   bool wasUpdated=false;
   int targetLogicTime=CalculateTimeFromSlidingWindowAsMentionedAbove();
       //calculate logic:
       calculateStuff();//put all your logic code here
       //limit and stabalize your FPS:
     drawStuff();//Draw everything here
       sleep(1ms);//give the CPU time to rest to avoid busy waiting.

Basically, this loop makes sure:

1. Your frame rate doesn't explode

2. If your drawing rate goes down, your game rate stays the same (car still takes 60 seconds to drive from A to B regardless of frame rate)

3. You don't draw redundant frames (frames where nothing has changed)

4. If available, you give the CPU some time to rest. (Very important for desktop CPU temperature, and laptop/phone battery life).


You can get better performance if you do this on two threads, but that's a whole other story.

#5092561 c++11 Multithreading not working! Please help!

Posted by SillyCow on 08 September 2013 - 05:20 PM

You have a race condition.

Thread 1 can notify thread 2  before thread 2 ever starts waiting.

So thread 2 will continue waiting forever because thread1 notified it when it wasn't waiting.


It is customary in these situations to wait and lock on the same mutex. That way you never miss a notification.

#5092523 Seeking Advice on Windows IDEs, Cygwin, Windows versions, et. al.

Posted by SillyCow on 08 September 2013 - 01:09 PM

Visual Studio is an Amazing C++ IDE.

By far the best C++ IDE I have encountered anywhere.

That said, getting the full experience is very expensive. (Even after you but V.S. you still need to shell out for some good plugins).

If you are a hobbyist, and are not ok with the express edition, don't use it.


If you are looking for alternatives, you can use Eclipse CDT or Netbeans.

Disadvantage is, they are very slow and poor in features.

Also, they were originally designed for JAVA, so some of the design seems clunky.

The advantage is they are free, and come preloaded with alot features such as refactoring.

Also, they work with several compilers: Cygwin, Ming32, etc...


Always use an IDE, preferably with an integrated debugger. Even when working with Linux.

#5090663 Should I learn how to draw?

Posted by SillyCow on 31 August 2013 - 02:44 PM

'images' like in real life pictures or just other peoples' drawings?

Doesn't matter. It's sort of like tracing over another picture. So it can be a photo, a sketch or anything else. The obvious advantage of drawing by yourself, is that you can get any picture you like. The obvious disatvantage is that it takes way more time then searching on google.



well if it takes just takes couple months to learn how to draw comic-book/cartoon art(assuming that I draw 2-3 hours a day and reach these results), I see no harm in learning how.

Make sure you take a course, or read a book. What a lot of people who do not draw fail to realise is that drawing is methodical. Just like you learn Loops, Methods, Data-Structures and Algorithms before you can program, you need to study drawing techniques. Just sketching on a piece of paper for a couple of months will not yield good results. It would be the same as opening an editor and writing random code smile.png .


I took a short course and practiced at home and it did wonders for me.




Then again, some don't draw pleasure from drawing I wish you luck however, it is a skill that will elude me forver, due to a lack of passion and patience for it.


Agreed, no amateur game-dev should draw unless it fascinates him or brings him some enjoyment. You can make excellent games without knowing how to draw. 

#5090605 Should I learn how to draw?

Posted by SillyCow on 31 August 2013 - 10:34 AM

also, Is drawing neccesarry for 3d games?

No. At the higher levels, you nead to model over a sketch. But you can download an image from the internet, and model over that.




should I learn how to draw too? like what if I want to test out some games, do I need artwork for it?
I mean im not trying to be michelangelo or anything, I just want to be competent enough to draw figures for game testing.

No, For testing purposes, you can use ugly art (stick figures/ 8 bit).


Regardless, learning how to draw is fun.

Alot of people don't try to learn it, and assume you are only born with it.

Learning how to draw decent comic-book level takes  around 1-2 months, art if you have no prior knowledge .

And you need a scanner to use your drawings in a game.

Do you have 1-2 months & a scanner?