Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (711)
Games in Android Showcase (213)
games submitted by our members
Games in WIP (785)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Contest with CPU/RAM usage resrtiction?  (Read 3026 times)
0 Members and 1 Guest are viewing this topic.
Offline Freeky

Senior Newbie

Medals: 1

« Posted 2013-09-18 14:27:58 »

Hey all,

I don't know a lot about hardware, nor do I have any idea what's going on inside my computer when it's running a game/program, but I thought of something and I was wondering of this would be possible.
The idea is to have a game contest with a maximum amount of memory you can use at any time while running the game. I don't mean file size, but more like RAM or CPU usage, so your have to be carefull with your calculations and release eny memory immediately when you don't need it anymore and stuff like that. Only I'm not sure if this is measurable and if the results are reliable, or if this is also dependent on wich hardware the game is running and maybe some other factors.

So, what do you think? Would this be possible? And just as important: Would this be fun?
Offline SHC
« Reply #1 - Posted 2013-09-18 14:38:49 »

You should then use native languages. Java's memory is only released by the gc and you cant force the gc.

Offline Freeky

Senior Newbie

Medals: 1

« Reply #2 - Posted 2013-09-18 14:47:26 »

Oh yeah, how could I forget that...

Well, nevermind then xD
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Damocles
« Reply #3 - Posted 2013-09-18 14:54:05 »

You could force to only use a single predefined array for all "memory" based calculations.


int[] memory = new int[40000];

any statically defined variable has to take up one "slot",

any other datastore construct like an Image has to be inserted and recovered from this memory-array before
beeing rendered, or so.

no recursions.

Would make very odd looking code though.
But theoretically it could impose a strict limit to verify agains.

Offline sproingie

JGO Kernel

Medals: 202

« Reply #4 - Posted 2013-09-18 14:59:30 »

How would this be fun?
Offline Damocles
« Reply #5 - Posted 2013-09-18 15:01:59 »

working within limits is arbitrary anyhow, but getting something done within these limits can be fun.

Offline SHC
« Reply #6 - Posted 2013-09-18 15:07:52 »


What you said are not limits, they are impossibles!

Online kappa
« League of Dukes »

JGO Kernel

Medals: 115
Projects: 15


« Reply #7 - Posted 2013-09-18 15:25:47 »

another option to limit ram usage is by capping the maximum memory available to the Java VM (via VM parameters).
Offline princec

« JGO Spiffy Duke »

Medals: 896
Projects: 3
Exp: 16 years

Eh? Who? What? ... Me?

« Reply #8 - Posted 2013-09-18 16:20:45 »

I still think the best format for limitation is time and unknown theme a la LD48. Use whatever tricks you can! Use whatever art and sound effects you can find! You've got 48 hours. But be aware your final rating will be attenuated by how closely your game adheres to the theme according to the judges.

Cas Smiley

Offline Freeky

Senior Newbie

Medals: 1

« Reply #9 - Posted 2013-09-18 16:37:10 »

@Damocles Yes, although I would find this quiet interesting to do, this would indeed result in very odd looking code and would be very hard to judge. Judges would have to look through the source code of every game to make sure they don't store anything in another variable. Also, I don't think there would be very many participants for a competition like that. And I don't even wanna think about what a pain it would be to be unable to use a String, but instead be forced to save the ASCII code of every character in an array of intergers. xD

@kappa Yes, I guess that would be the best way indeed, unfortunately, like SHC stated, you have little to no control over the garbage collector and thus it would be very hard to write a game of wich you can be the memory usage stays just under the maximum.

I was just trying to think of a new way of limitation, came up with this idea and thought I'd throw it here and see other peoples opinions. However, I think I am convinced now that this is not going to work at all.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Cero
« Reply #10 - Posted 2013-09-18 18:39:28 »

How would this be fun?
int[] memory = new int[40000];
Oh yeah loads of fun. Let's have a String you want to save, you first get all the chars, then iterate over them, casting each to int and saving them to the array. And the same if you want to get it back plus StringBuilder. By the end you don't even know what String you had to begin with, lets take a look, ah yes it was "fuck you damocles", how odd, maybe I messed up the order :D

@RAM limitation:
Well this isnt C/C++, its nearly impossible to micro manage on such a small scale in java and definitely annoying as all hell.
@VM Ram cap limit: Well you still have the problem that all textures have to go through system RAM before getting into VRAM, and if the cap is too low you would have to split a texture up and shit.
@CPU usage limit: doesnt work, everybody has different processors, and with java and the jvm there too much overhead going on from preventing sudden spikes or whatever

@timed (and themed) contest: Yeah I guess that works as LD48 shows. More accessible and everything.
Still there is like a fixed point in time where you have to have free time, cant to it later; Then you have to record it to prove it and stuff... insert more of my whining here...

It's hard to think of reasonable limitations for a game competition besides amount of game size and dev time. But yeah, most important thing is that a developer can focus on the game and gameplay and not on technology.

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Archive (84 views)
2017-02-27 19:41:49

Riven (77 views)
2017-02-27 17:26:59

numerical (445 views)
2017-02-21 07:32:16

numerical (449 views)
2017-02-21 07:31:46

theagentd (559 views)
2017-02-18 13:42:33

theagentd (555 views)
2017-02-18 13:35:16

h.pernpeintner (1730 views)
2017-01-24 22:39:11

h.pernpeintner (1686 views)
2017-01-24 22:38:32

Galdo (2268 views)
2017-01-12 13:44:09

Archive (2183 views)
2017-01-02 05:31:41
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!