Sign in to follow this  
DaltonChancellor

What language should this be written in?

Recommended Posts

So, I'm working on a java project right now, but I had an idea today that I told one of my partners and he liked it. Here's the idea: The game has full access to the files on your computer. It asks you if that's okay when you start playing. If you say no, you get a premade map. If you say yes, it take each folder, and if a folder has over 2000 files in it (like the C drive), it makes a large city in-game. A folder with around 100 files in it creates a building. Each file gets a "room" within the coresponding building, within the corresponding city. Between cities, their are wastelands and roads. Each file creates an NPC, with completely random characteristics, there being a 50/50 chance of being male/female. The NPCs will retire to their corresponding rooms, though when they are out, they go out on the town. It will be pretty similar to the Tron movies. Is this possible? And if so, what language should it be written in?


I realize that this is a giant project, and I don't plan to start it until I become much better at coding, among other things. Thanks.

Share this post


Link to post
Share on other sites
A game that accesses literally HUNDREDS of thousands of files on the computer system will just take FAR too long to load. Think of how long a run of an anti-virus software with "Full scan" settings takes on your system. Even if your game processes an entire folder every second it might still take more than a couple of hours just to generate the map. And add to that all the graphics (I assume it's a graphical game) requirements, it might take a longer time than that to start the actual playing.

More things to think about:

1. How will you generate the NPC models? What characteristics will an NPC have? Since you say NPC will be totally randomized, how will you set up their interactions with the main character (I assume this is going to be an RPG game correct me if I am wrong).
2. How will you organize the map positions, directions and specific locations? How will the positions of cities and wastelands be determined? Too much randomization might result in unplayable maps, too easy maps, too difficult maps, or maps without any aesthetic value.
3. Since the map is totally dynamically generated, how will you ensure certain specific requirements for the game to be properly playable (e.g. a particular character or a city etc.)?
4. Last but not the least what is the nature of the game and scope of the project?

Specifics are very important. There is an old saying that the devil is in the details.

As far as programming language choice is concerned, you might have no choice but to go with C or C++ because of the speed requirements of something as massive as what you're planning. And even C might choke on the folder/file scanning part.

However, the idea itself is very unique and interesting. Never heard of something like this.

Share this post


Link to post
Share on other sites
[quote name='FlyingDutchman' timestamp='1318696774' post='4872892']
cool idea, i steal it :0) thanks a lot ^^

.
.
.
.

joke..


what shall the graphic engine be? 3d 2d text based? i would say unless u don't want cutting edge graphic technology with high speed rendering java is fine
[/quote]

Rendering is just as/almost as fast in Java as it is in C or C++ so that shouldn't be a problem, (The way modern rendering works makes the underlying language mostly irrelevant)

The only real performance issues he is likely to run into with Java are the ones related to floating point math (There are a few pitfalls if you run on the x86 platform due to how Java guarantees higher precision on some operations than the x86 architecture can deliver nativly (trig functions have to be handled carefully for example and will in some cases be several orders of magnitude slower than native)) and memory management (Which you have very little control over with Java). (There are native math and physics libraries you can use to get around these problems)

The big question really is:

Does the content of the files matter ?

If it does this idea will not work that well due to the insane loadtimes you can get, but if all you need is basic file attributes (name, size, etc) there shouldn't be any problems.

Share this post


Link to post
Share on other sites
Wouldn't you just call a method like: Folder. FileCount or something? I'm pretty sure Java has methods that do something similar to that and it shouldn't take that long. And no, you should NEVER, EVER have to scan the files for any reason (like a AV does).

Though honestly, I'd be spooked if your game needed to go through my HD like that. I'd probably just get the pre-made maps everytime.

Share this post


Link to post
Share on other sites
[quote name='Alpha_ProgDes' timestamp='1318704915' post='4872929']
Wouldn't you just call a method like: Folder. FileCount or something? I'm pretty sure Java has methods that do something similar to that and it shouldn't take that long. And no, you should NEVER, EVER have to scan the files for any reason (like a AV does).

Though honestly, I'd be spooked if your game needed to go through my HD like that. I'd probably just get the pre-made maps everytime.
[/quote]

Exactly this. Also, I have no idea what you would actually [b]do[/b] inside such a game.

Share this post


Link to post
Share on other sites
[quote name='SimonForsman' timestamp='1318704630' post='4872928']
The only real performance issues he is likely to run into with Java are the ones related to floating point math (There are a few pitfalls if you run on the x86 platform due to how Java guarantees higher precision on some operations than the x86 architecture can deliver nativly (trig functions have to be handled carefully for example and will in some cases be several orders of magnitude slower than native)) and memory management (Which you have very little control over with Java). (There are native math and physics libraries you can use to get around these problems)
[/quote]

Also, dont forget range checks on every array access and other such things to guard against incompetent programmers...
Flipping an image, which with a simple for loop in C would take 2ms can easily take 400ms in java (actual numbers from android project)

Good thing there is JNI for when java gets too insane ;)

Share this post


Link to post
Share on other sites
[quote name='Zahlman' timestamp='1318837033' post='4873363']
[quote name='Alpha_ProgDes' timestamp='1318704915' post='4872929']
Wouldn't you just call a method like: Folder. FileCount or something? I'm pretty sure Java has methods that do something similar to that and it shouldn't take that long. And no, you should NEVER, EVER have to scan the files for any reason (like a AV does).

Though honestly, I'd be spooked if your game needed to go through my HD like that. I'd probably just get the pre-made maps everytime.
[/quote]

Exactly this. Also, I have no idea what you would actually [b]do[/b] inside such a game.
[/quote]
There was one game, I think it was called "Virus: The Game", with a similar premise: you were fighting viruses in your hard drive. It would grab pictures and audio from your hard drive to generate environments. Though, by all accounts it was pretty bad.

Share this post


Link to post
Share on other sites
Seems I stepped on someones toes with my java comment :P

Still, I don't like un-necessary range checks that slow down my code.
If my algorithm can guarantee the index will never go out of range, thats enough of a range check in my book.
And having no way to access memory blocks pointer-style, any algoritm that wants to process lots of data will be a lot slower.
If thats not a weakness in the language, I don't know what is.

If you disagree, I'd love to hear why :) (I'm all aout learning)

But I think I'm straying way off topic for this thread, maybe a PM?

Share this post


Link to post
Share on other sites
[quote name='Olof Hedman' timestamp='1318874392' post='4873562']
Seems I stepped on someones toes with my java comment :P

Still, I don't like un-necessary range checks that slow down my code.
If my algorithm can guarantee the index will never go out of range, thats enough of a range check in my book.
And having no way to access memory blocks pointer-style, any algoritm that wants to process lots of data will be a lot slower.
If thats not a weakness in the language, I don't know what is.

If you disagree, I'd love to hear why :) (I'm all aout learning)

But I think I'm straying way off topic for this thread, maybe a PM?
[/quote]


thanks.. :-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this