Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 14 15 [16] 17 18 ... 22

Author Topic: DrPoo's programming Jam, 100*C, a community project, that actually works.  (Read 42505 times)

GalenEvil

  • Bay Watcher
    • View Profile
    • Mac-Man Games

Quick question: Should we use ULong values for item IDs, max value of 18,446,744,073,709,551,615 which is the same as a UInt64, or should we use UInt32 values, max value of 4,294,967,295? Unsigned integer types are not CLS compliant though, so it may be better to use Int32 or Long values as their max values would be 2,147,483,647 and 9,223,372,036,854,775,807 respectively. Of course Long is just Int64 at heart, so if we are intending to keep this completely platform independent I am not sure if using long values is the best thing to do. In any case, if we separate the item (Object) IDs into their specific types I don't see why we would need more than the max value for Int32 of 2,147,483,647. That is a lot of objects for the computer to keep track of even with just one object type being spawned into that many individual objects.

I am trying to make sure that every item can be addressed and searched for by its ID number to possibly cut down on some list size issues I predict to run into with a full scale run of my code. Any ideas on what I should encode the ID numbers' type to would be appreciated.
Logged
Fun is Fun......Done is Done... or is that Done is !!FUN!!?
Quote from: Mr Frog
Digging's a lot like surgery, see -- you grab the sharp thing and then drive the sharp end of the sharp thing in as hard as you can and then stuff goes flying and then stuff falls out and then there's a big hole and you're done. I kinda wish there was more screaming, but rocks don't hurt so I guess it can't be helped.

Mullet Master

  • Bay Watcher
    • View Profile

Quick question: Should we use ULong values for item IDs, max value of 18,446,744,073,709,551,615 which is the same as a UInt64, or should we use UInt32 values, max value of 4,294,967,295? Unsigned integer types are not CLS compliant though, so it may be better to use Int32 or Long values as their max values would be 2,147,483,647 and 9,223,372,036,854,775,807 respectively. Of course Long is just Int64 at heart, so if we are intending to keep this completely platform independent I am not sure if using long values is the best thing to do. In any case, if we separate the item (Object) IDs into their specific types I don't see why we would need more than the max value for Int32 of 2,147,483,647. That is a lot of objects for the computer to keep track of even with just one object type being spawned into that many individual objects.

I am trying to make sure that every item can be addressed and searched for by its ID number to possibly cut down on some list size issues I predict to run into with a full scale run of my code. Any ideas on what I should encode the ID numbers' type to would be appreciated.

I'll give my unprofessional opinion. I think INT32 will be okay. I can't think of a single int64 reason and you have given several reasons that int64 is a bad idea. If every mineable block in the game had an object ID# - that would make an approx 1392 x 1392 x 1392 cube. That's a pretty big game world, no?

Logged

GalenEvil

  • Bay Watcher
    • View Profile
    • Mac-Man Games

Okay, I wasn't specifically thinking about the mineable voxel pieces but that is a good point. A plot that sized would take an immense amount of time to go through and would end up being a pretty massive world. Possibly greater than the world that DF inhabits. If that was reduced to essential 1 voxel = 1m^3 and the game-plot's surface = 1km x 1km then the depth would be a little more than 2km in depth. I don't think that the world would need to be that deep, so an Int32 would probably be best for it.

Even with each item/object having a non-individual type ID number I expect to still be able to work within 2 billion possible pieces. I will need to work through some stuff to figure out what would be the best way of dealing with everything...
Logged
Fun is Fun......Done is Done... or is that Done is !!FUN!!?
Quote from: Mr Frog
Digging's a lot like surgery, see -- you grab the sharp thing and then drive the sharp end of the sharp thing in as hard as you can and then stuff goes flying and then stuff falls out and then there's a big hole and you're done. I kinda wish there was more screaming, but rocks don't hurt so I guess it can't be helped.

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile

A bigger problem I see is that at 2 billion pieces, there is only enough RAM for an average of 1.5 bytes per piece (assuming a 32 bit machine).
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile

A bigger problem I see is that at 2 billion pieces, there is only enough RAM for an average of 1.5 bytes per piece (assuming a 32 bit machine).
Only if you load the entire map and all objects in it at once. Off-screen stuff you can put in an sqlite db or something, and load as-needed.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

GalenEvil

  • Bay Watcher
    • View Profile
    • Mac-Man Games

Ah yes, Virex you have destroyed my argument! I guess I will have to encode the IDs in bit notation then >,.,>
Logged
Fun is Fun......Done is Done... or is that Done is !!FUN!!?
Quote from: Mr Frog
Digging's a lot like surgery, see -- you grab the sharp thing and then drive the sharp end of the sharp thing in as hard as you can and then stuff goes flying and then stuff falls out and then there's a big hole and you're done. I kinda wish there was more screaming, but rocks don't hurt so I guess it can't be helped.

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile

Right, in case anyone is interested, the latest track generation code is up on the google code page. Not much has changed since the previews except that the track is now automatically split into shorter segments. I intend to use this for track components like switches et cetera. Anyway, it's there in case you want to make some track art ;)
Logged

Kofthefens

  • Bay Watcher
  • Keep calm and OH GOD CAPYBARAS
    • View Profile
    • Marshland Games

Virex -  I was working a bit on the code for having robots build tracks. Will this work for a track creation job, or did I misunderstand your instructions from the conference completely?

The important stuff is in workOn()

Code: [Select]
using UnityEngine;
using System.Collections;

public class TrackConstructionJob : ConstructionJob {

int startX, startY, startZ;
int endX, endY, endZ;

public TrackConstructionJob(int nstartX, int nstartY, int nstartZ, int nendX, int nendY, int nendZ)
:base(nstartX, nstartY, nstartZ)
{
startX = nstartX;
startY = nstartY;
startZ = nstartZ;

endX = nendX;
endY = nendY;
endZ = nendZ;
}

public bool workOn(double workspeed, Robot robot){
bool isDone = base.workOn(workspeed, robot);

if (isDone){
SplineControlPoint[] points = new SplineControlPoint[3];
points[0] = new SplineControlPoint(new Vector3((float) (startX), (float)(startY), (float)(startZ)),
new Vector3(-1,-1,-1), new float[] {50, 50});
points[1] = new SplineControlPoint(new Vector3((float)(endX), (float)(endY), (float)(endZ)),
new Vector3(-1,-1,-1), new float[] {50, 50});

Spline3D path = new Spline3D(points);
path.Subdivide(2);
}
return isDone;
}

}

This is just one class in a fair amount of classes that manage jobs, but it is the one that creates a track.




EDIT: We should have another IRC conference this weekend, but people should actually show up this time.
« Last Edit: May 09, 2012, 06:17:56 pm by Kofthefens »
Logged
I don't care about your indigestion-- How are you is a greeting, not a question.

The epic of Îton Sákrith
The Chronicles of HammerBlaze
My website - Free games

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile

Your code generates the spline along which the track will be generated, but, as it currently stands, you'll need to call genRail twice to generate both rails:
Code: [Select]
genRail(path, 1, 4); //First argument is the width of the rail, the second the amount of rail widths it is from the center of the track.
genRail(path, 1, -4); //This has to be adjusted to properly scale the tracks to the size of a voxel in world units.
(genRail is currently part of the Track script. I'll look into moving it to Spline3D or a class that derives from it so you don't have to worry about it.)

Unless of course you mean to generate the mesh in another function.

Also, I've added function called Rasterize to the Spline3D class, which cuts the Spline3D up into splines smaller than the specified length and returns them in an array. You may want to use that to construct the track piece-by-piece instead of all at once.
« Last Edit: May 09, 2012, 06:26:32 pm by Virex »
Logged

Kofthefens

  • Bay Watcher
  • Keep calm and OH GOD CAPYBARAS
    • View Profile
    • Marshland Games

Okay. I have it working well enough, so I'll take a break until the weekend. Hopefully you'll optimize the minecart stuff a bit for me.

Dr Poo - Have you done anything on workshop menus?
Araph - anything on concept art or texturing?
malloc - anything new on the voxels?

Sorry if I'm nagging you, I'm just trying to get an idea of what everybody has / is working on.
« Last Edit: May 09, 2012, 09:21:05 pm by Kofthefens »
Logged
I don't care about your indigestion-- How are you is a greeting, not a question.

The epic of Îton Sákrith
The Chronicles of HammerBlaze
My website - Free games

GalenEvil

  • Bay Watcher
    • View Profile
    • Mac-Man Games

Made some progress on a mini-goal I had set for myself. I am trying to encapsulate the actual data structures for adding and removing cart tracks into a nifty interface where you basically just have to tell it add(This specific track) or remove(This specific track/ this specific track by its ID#) and it will just do it for you and figure out all the other nifty stuff that adding and removing tracks has to do:
* Create contiguous paths which are separated into groups
* Merge and Split groups to reduce redundancy

Still need to work out a few kinks in the removal system and then I can incorporate Virex's code into it. Should be able to start the work on having it make routes and return them given a start and end location. For that part I would need to know more about the workings of the Terminals because if they will only be able to hold a single cart at a time it will make scheduling more important then it is already.
I am thinking of using Dijkstra for the cart AI system since it is a closed system and it shouldn't take too long to batch process routes even for a large number of stations in a large completely unified track system.
Figured I should post so that people know that this project hasn't yet been abandoned! And also to let Kof know what I have been working on :D

Once I get my mini-goal worked out I will work on some higher level optimizations on path-picking for the Robots, if Kof can send me the code for what he has already so I can do some tests on it against my algorithms.

How detailed should the Wiki be? I could make several pages more about specific things I am doing as well as a page for the test results that I have gathered, if it seems like a good idea.

Let me know what you all think about things! We mustn't let this project die!!!

EDIT!!!

Just a Future Feature question this time :D

Are we going to try and implement any rival Robot groups in this game? Just throwing the idea out there, hopefully we can discuss it tomorrow at the meeting (assuming people show up).
« Last Edit: May 11, 2012, 02:56:55 pm by GalenEvil »
Logged
Fun is Fun......Done is Done... or is that Done is !!FUN!!?
Quote from: Mr Frog
Digging's a lot like surgery, see -- you grab the sharp thing and then drive the sharp end of the sharp thing in as hard as you can and then stuff goes flying and then stuff falls out and then there's a big hole and you're done. I kinda wish there was more screaming, but rocks don't hurt so I guess it can't be helped.

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile

Well, we can discuss the terminals in detail on the next meeting.


In the mean time I have sanitized and committed the track generation API. Currently we have a TrackFactory prefab which has a TrackFactory script in which some constants can be changed (track width, track spacing, smoothness, length of individual track section and track prefab, the latter containing things like the physics material). This factory object has a single public function called genTrack, which takes an array of SplineControlPoints and returns an array of transforms, with each Transform being a track prefab.


What  am not entirely sure about is how I'm going to handle replacing track sections for connecting tracks and adding things like stations. We'll probably have to do some sort of proximity check when assigning a new track section and have it snap to the existing sections if it gets too close. I'll have to store some information for that on the track sections though.
« Last Edit: May 11, 2012, 04:45:53 pm by Virex »
Logged

GalenEvil

  • Bay Watcher
    • View Profile
    • Mac-Man Games

How do I download things from the repository to my computer other then going one by one through the items and downloading them manually via "View Raw File" option? If I can use git or mercurial to connect and download that would be a better option so it could be a batch download :D
Logged
Fun is Fun......Done is Done... or is that Done is !!FUN!!?
Quote from: Mr Frog
Digging's a lot like surgery, see -- you grab the sharp thing and then drive the sharp end of the sharp thing in as hard as you can and then stuff goes flying and then stuff falls out and then there's a big hole and you're done. I kinda wish there was more screaming, but rocks don't hurt so I guess it can't be helped.

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile

If you're on windows, get git from here: http://code.google.com/p/msysgit/downloads/list?can=2&q=%22Full+installer+for+official+Git+for+Windows%22 (use the top link).


If you want to make things easy for yourself, get TortoiseGit from here: http://code.google.com/p/tortoisegit/. It adds some options to the right-click menu so you can easily interface with git without resorting to the command line. The use git clone from the right click menu to clone the repository. Once cloned, you can use git commit to commit changes to your local repository (this doesn't change the repository on the site) and git sync to pull changes from the site or push your local copy to the site. You'll need your personal google code password to push changes, which you can find here: https://code.google.com/hosting/settings after logging in to google.
« Last Edit: May 11, 2012, 05:40:08 pm by Virex »
Logged

GalenEvil

  • Bay Watcher
    • View Profile
    • Mac-Man Games

Thanks for the link to TortoiseGit :D I have regular Git already but I have never used it before so didn't know how to do anything >.< I tried to clone the repository earlier but my connection flubbed up and it failed, might have to wait until next week when I will be away on holiday to get everything set up. Going to visit my cousins a few states over, not really looking forward to it ~,.,~
Logged
Fun is Fun......Done is Done... or is that Done is !!FUN!!?
Quote from: Mr Frog
Digging's a lot like surgery, see -- you grab the sharp thing and then drive the sharp end of the sharp thing in as hard as you can and then stuff goes flying and then stuff falls out and then there's a big hole and you're done. I kinda wish there was more screaming, but rocks don't hurt so I guess it can't be helped.
Pages: 1 ... 14 15 [16] 17 18 ... 22