Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 ... 11
1  Game Development / Newbie & Debugging Questions / Re: LWJGL - Immediate rendering alternative on: 2014-12-17 21:07:14
Use GL_LINES instead of GL_LINE.

In addition, if you need to display A LOT of lines/points/anything else and you don't want to change rendering data often, you can use display lists for significant performance boost.
2  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-12-06 20:22:32
https://gist.github.com/Warlander/0a786007e6d1e68355b6

Gist updated. Smiley I will probably refactor project and make WIP thread soon.
3  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-12-06 01:50:47
If you release the code (the pastebin would work, Gist would be better), we could probably speed that up quite a bit. 2s sounds slow, although I'm forgetting what all is involved with fractal gen.
It's diamond-square, right?

Looks good though!

https://gist.github.com/Warlander/0a786007e6d1e68355b6

Edit: XOR random generator improved generation speed by about 30%.

Edit2: Added multithreading, now 8192X8192 fully detailed map is generated in 14 seconds instead of 33.
4  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-12-06 00:51:29
Experimented with procedural terrain generation again, now with fractals:



I wrote this generator in 2 hours, but even after such a short time I am able to say that fractal-based generation is superior to noise-based (especially simplex noise). Main advantages of this random generation method:

  • VERY fast generation
  • possibility to generate less detailed, very similar looking maps on demand
  • only small amount of repeating patterns (probably possible to fix with better random function)
  • easily configurable
  • lazy generation

Generation times:
2048X2028 (seen above), full detail - ~2,3s
8192X8192, full detail - 33s
8192X8192, very high detail (almost the same as full detail, with just one generation layer less) - 23s
8192X8192, high detail (first noticeable quality loss) - 14s
8192X8192, low detail (very noticeable quality loss, but still should look acceptable in the far distance in case of 3d games) - 8s

I will try to improve this generator further, this looks very promising.
5  Discussions / Miscellaneous Topics / Re: C#, did Microsoft just want to be different? on: 2014-12-02 01:02:22
Most of this stuff seems like attempt to avoid boilerplate code... By adding unreadable code. Smiley
6  Discussions / Miscellaneous Topics / Re: Language with direct RAM<->HDD communication on: 2014-11-29 19:35:14
Yes, but in case of paging you don't have any control on what is in memory and what is stored on HDD - I am thinking mostly about something like database built directly in language which is deleted after program execution stopped.
7  Discussions / Miscellaneous Topics / Language with direct RAM<->HDD communication on: 2014-11-29 19:22:26
Why nobody invented language with built-in direct RAM<->HDD communication so far? I think this would have many pros (if used right), even in modern times where RAM is getting cheaper and cheaper.

Some examples (in Java code):

Example class:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
import java.util.ArrayList;

public class ExampleClass {

    //field for internal JVM use only, possibly by GC
    private boolean loaded = true;
   
    private ArrayList<String> list;
   
    public ExampleClass() {
        list = new ArrayList<>();
    }
   
    public ArrayList<String> getList() {
        return list;
    }
   
    public void setList(ArrayList<String> list) {
        this.list = list;
    }
   
    //this method should be directly in Object class
    public boolean isLoaded() {
        return loaded;
    }
   
    //this method should be directly in Object class
    public void setLoaded(boolean loaded) {
        this.loaded = loaded;
    }
   
    public void doSomething() {
        //do something here
    }
   
}


Example 1:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
public static void main(String[] args) {
        //new object is created in memory
        ExampleClass obj = new ExampleClass();
        obj.getList().add("Hello World!");
        obj.doSomething(); //working as usual

        obj.setLoaded(false); //JVM receives hint that obj and everything inside should be unloaded from memory and moved to HDD on next GC cycle
        obj.doSomething(); //still working as usual, unless GC cycle happens between this and previous call
       
        System.gc();
        obj.doSomething(); //obj is loaded from HDD and is stored here until end of method and next GC cycle, if called method is using list inside obj, then this list is loaded as well
       
        obj.setLoaded(true); //the whole obj is loaded from HDD to memory and deleted on HDD
        obj.doSomething(); //working as usual
    }


Example 2:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
public static void main(String[] args) {
        ExampleClass first = new ExampleClass();
        ExampleClass second = new ExampleClass();
       
        first.setList(second.getList());
       
        second.setLoaded(false); //only second will be unloaded to HDD on GC as list is used somewhere else
        System.gc();
        first.list.add("Hello World!"); //works as usual
        second.doSomething(); //second is loaded from HDD, but list inside is in memory all the time
       
        first.setList(new ArrayList<>()); //reference to list inside second object is erased
        System.gc(); //list inside second object is unloaded to HDD
        second.doSomething(); //obj is loaded from HDD and is stored here until end of method and next GC cycle, if called method is using list inside obj, then this list is loaded as well
    }
8  Game Development / Newbie & Debugging Questions / Re: Saving and loading gfame data with file i/o on: 2014-11-29 02:46:23
Pros and cons of each method:

1. XML/JSON
+very flexible
+easy to edit (for example for debugging)
+easy to implement in OOP way (especially XML)
-takes a lot of space (in comparison with other methods)
-easy to edit (if you are worried that users will edit save data, but you shouldn't)
-needs some boilerplate code

2. Text formats
+very easy to implement
-very dependent on programmer skills and design decisions

3. Binary format
+very fast saving/loading
+takes very small amounts of space
+hard to edit (if you are worried that users will edit save data, but you shouldn't)
-inflexible (in some cases you even need to write a new loader after changing something, in addition to maintaining code for older saves)
-hard to edit (if you want to change some values inside save for debugging or testing purposes)

For most of games, I would choose XML unless you need to save/load a lot of data, then I would choose binary format (but still use XML as alternative for debugging and testing).

In your case even text file should be enough.
9  Game Development / Newbie & Debugging Questions / Re: How to integrate Lua into Java? on: 2014-11-29 01:43:45
What would you recommend for scripting in Java? Lua or JS?

I think this is matter of personal preference - from my experience Lua is better suited for (especially large) games, but with both of them you should be able to implement scripting easily.
10  Game Development / Networking & Multiplayer / Server UI - graphical vs command line on: 2014-10-15 16:14:10
Like in topic - what do you think, is it better to be able to control server via GUI or command line? I wonder which solution is better - command line should work everywhere and is very easy to make, but GUI should be faster and easier to use and be able to show more data at the same time.
11  Discussions / General Discussions / Re: New feature: registration and login through Facebook, Google, etc on: 2014-10-11 17:30:10
We have registration through Facebook and Google now, so... How about Facebook page? Roll Eyes
12  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-10-01 20:15:31
First day of university, CS naturally. Smiley
13  Discussions / Miscellaneous Topics / Re: Java won't let me time travel on: 2014-09-30 20:40:43
LocalDateTime.now().minusYears(10);

Why not this way?
14  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-09-30 00:10:50
I tested my knowledge in Paint.net and threw this together.


I used "I Want My TTR!" for and "Lapetus" for the fonts.
I'm actually thinking of making a cyberpunk themed action game too. Which was part of the reason ;-)

This reminds me of Far Cry 3: Blood Dragon - really similar style. Smiley
15  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > KICKSTARTER, GREENLIGHT AND NEW BUILD LAUNCHED < on: 2014-09-25 13:55:55
I can translate this game into Polish. Smiley
16  Discussions / Miscellaneous Topics / Re: Whays the story behind your name on: 2014-09-23 01:11:57
Mac70 - from real name Mac(iej), I don't know why 70, especially as this is very, very old nick. Roll Eyes
17  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > KICKSTARTER, GREENLIGHT AND NEW BUILD LAUNCHED < on: 2014-09-23 00:19:30
Good luck on Kickstarter and Greenlight, here comes my upvote (and small tip soon). Smiley
18  Discussions / General Discussions / Re: Can a Single Developer Create a Big Game? on: 2014-09-07 10:24:36
There was MMORPG Shores of Hazeron which was developed by one person - veeery huge and complex game, but sadly it was closed last month.
19  Game Development / Newbie & Debugging Questions / Re: Return int from Method on: 2014-09-06 01:27:39
In addition, your method naming convention is different from the standard one - take a look at camelCase naming convention, especially if you will want to write library or open source project in the future. Smiley
20  Discussions / Miscellaneous Topics / Re: What other programming languages do you use & why? on: 2014-09-04 12:02:40
C++ at its root is not bad, but lack of standardization is sometimes making coding in it a nightmare. Smiley
21  Discussions / Miscellaneous Topics / Re: What other programming languages do you use & why? on: 2014-08-31 15:23:30
C++ - very rarely, I use it only when I need to use some native code (and call it via JNI) or do purely platform specific thing.
PHP - I prefer it over Java when it comes to website servers - much easier to use, without need to learn many weeks or even months to actually be able to make even a simple site like in Java.
Haxe - I HATE JavaScript, so I use this language instead of it when I want to do something in JS. Somewhat similar to Java, but have some small, irritating flaws and lack of good IDE.
XML - if we can this language, XML in my opinion is very good for serialization, properties and anything else like this.
22  Discussions / General Discussions / Re: Performance Test for the Voxel Thing on: 2014-08-28 12:46:39
55-61 FPS when using dedicated GPU (NVIDIA GeForce GT 630M).
23  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-08-23 00:14:24
Few hours ago I started learning Haxe ( http://haxe.org/ ).

I was programming a web game client in JavaScript, but quickly discovered that except very simple cases this is really bad idea, so I switched to another language which compiles to JS, but have Java-like packages and classes structure.

(don't worry, servers are written in Java Wink)
24  Discussions / Miscellaneous Topics / Re: What I did today on: 2014-08-22 13:33:24
Nice effect! Smiley What shader are you using for it?
25  Discussions / Miscellaneous Topics / Re: Programmer Radio Station on: 2014-08-22 00:18:23
Everything depends just on your music taste, I would say that listening to music while programming is usually a distraction though.
26  Discussions / Business and Project Management Discussions / Re: Programming freelance on the internet: compete with cheap foreigners on: 2014-08-21 19:13:06
I was thinking about similar thing few days ago as well and found this article:

http://blog.jpl-consulting.com/2011/12/why-i-will-never-feel-threatened-by-programmers-in-india/

Europe/North America just have different culture - programming is seen as a job as well as hobby here and hobbyists tend to be better at their job (and therefore write better quality code). India surely have some hobbyists as well, but I think that ratios of hobby/"just job" programmers in our cultures are higher. In case of any problems with their programs, programmers who are not on the other side of the world can respond to requests much quicker as well.

In addition, culture differences might lead to misunderstandings, especially if freelancer must show some creativity.
27  Discussions / Miscellaneous Topics / Re: How often do you code on: 2014-08-18 19:26:41
Depends on mood and if I have enough free time - sometimes I am not coding at all, sometimes I can write code for 12-14 hours in a row (mostly when I have a lot of motivation - learning something new or implementing very important feature). Usually 3-4 hours though.
28  Discussions / General Discussions / Re: Netbeans + Gradle = Im annoyed. on: 2014-07-27 13:36:21
You can just use different project group for every project which is composed from many smaller projects - in this way everything is much cleaner. Smiley
29  Discussions / General Discussions / Re: New feature: Embedded PDFs on: 2014-07-19 16:53:35
You are using very old version, newest one is 22.0.1471.70. Smiley You need to download it manually as Opera don't have auto update feature (at least in old versions, I am not sure if new versions have it or not).
30  Discussions / General Discussions / Re: New feature: Embedded PDFs on: 2014-07-19 16:37:11
Sadly this feature don't work on Opera - even though it is using the same engine as Chrome. After clicking "click this page to load the PDF" download is initalized, but nothing appears.
Pages: [1] 2 3 ... 11
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (21 views)
2014-12-14 19:50:38

BurntPizza (42 views)
2014-12-09 22:41:13

BurntPizza (76 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (51 views)
2014-12-03 16:27:13

CopyableCougar4 (49 views)
2014-11-29 21:32:03

toopeicgaming1999 (115 views)
2014-11-26 15:22:04

toopeicgaming1999 (105 views)
2014-11-26 15:20:36

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org 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‑gaming.org
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!