Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (731)
Games in Android Showcase (217)
games submitted by our members
Games in WIP (798)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2 3 ... 10
 1 
 on: 2017-06-23 18:43:18 
Started by theagentd - Last post by theagentd
That's actually a pretty good idea! I'm currently in Italy on vacation though, but I'll post a proper challenge when I get back!

 2 
 on: 2017-06-23 18:08:25 
Started by theagentd - Last post by KaiHH
Make it a contest here! Smiley

Provide 4-5 example "byte arrays" of your tile chunk data and maybe a simple test fixture that calls a user-implemented compress(InputStream in, OutputStream out) and prints the compression ratio and then calls the other user-implemented decompress(InputStream is, OutputStream out) to validate with the initial data.

 3 
 on: 2017-06-23 17:46:11 
Started by theagentd - Last post by theagentd
@SHC
A pooled Node version would probably be slightly worse performance-wise when looping over the list due to the Node object and the element object being in two different places in memory. Also, without exposing the pointers, it becomes a bit annoying to loop through the list, but that's no real concern I guess.

@jono
Interesting, it'd be cool to see a.comparison between that and my implementation.

@Riven
Hmm, how exactly would that work?

 4 
 on: 2017-06-23 17:34:01 
Started by theagentd - Last post by theagentd
I need to compress a 32x32 chunk of tile data. The data consists of 1 byte for the terrain type, and 1 short for a detail tile (second layer essentially). The terrain tiles are very continuous, while most detail tiles are 0 (null). What would a good compression method?

Here's my current idea:

1. Reorder data into z-curve order or Hilbert curve order to improve spatial coherency

2. Run length encode data using a special repeat byte/short value (say Byte/Short.MAX_VALUE) followed by number of repetitions, like this:
 baaaaab ---> ba*5b

3. Compress data using a precomputed Hilbert code. The idea is to precompute several Hilbert trees from statistical data from a lot of worlds based on the two most common tiles in the chunk, so there'll be one tree for each biome essentially. The chunk encodes a byte for which tree to use, then the encoded data. The RLE symbol is encoded in the tree, but the RLE count could be encoded using a different huffman code tree specifically for RLE counts.

My question is: Would this beat the DEFLATE compression I'm currently using? Is it even worth trying to implement this? I feel like DEFLATE should have problems compressing small chunks of data like this as it tries to learn about the data as it goes. Also, would it make sense to use delta encoding here?

 5 
 on: 2017-06-23 16:59:14 
Started by FabulousFellini - Last post by philfrei
Finished a draft of the API. Am working on html page for posting, and figuring out license (worst case scenario: requirement to post a single link on an "About" page or "Credits" page).

TinySound is a good library! Glad you gave it a try.

AudioCue will have some advantages and disadvantages. It doesn't mix everything together into a single output line (advantage TinySound) but I can't recall if TinySound has real time volume, panning and frequency changes, or if it lets you position the "playhead" to different points. I probably should have looked closely at its API before designing mine, though. I think AudioCue will be similarly easy to use (or at least in the ballpark).

All right, I actually have a hour to work on it this morning--better stop procrastinating.

 6 
 on: 2017-06-23 13:13:41 
Started by BurntPizza - Last post by Icecore
I find the way abuse interfaces to add in java Namespaces ))
From cons you need refactor all project to it (except use it local)
and this is obvious if you want add Namespace in code without it)

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  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
   /*
   __NS pref is global Modules Namespace
   */

   //Its local namespace - for gather all usage add use them in module by one line
   public interface __NS_Parse_Data__Self extends
      _P_Parse_Data_A,
      _P_Parse_Data_B,
      _P_Parse_Data_C{
   }
/****************************/
   /*
   _P pref is Namespace for local module Use
   */

   //Our Namespace  _P_Parse_Data_A
   public interface _P_Parse_Data_A{
      //no public mod to hold it in Namespace and prevent Autoimport to take it)
      static class Data_Object_A implements __NS_Parse_Data__Self{
         static int IN_A = 0;
      }
   }

   public interface _P_Parse_Data_B{
      static class Data_Object_B implements __NS_Parse_Data__Self{
      }
   }
   
   public interface _P_Parse_Data_C{
      static class Data_Object_C implements __NS_Parse_Data__Self{
      }
   }
/****************************/
   public interface __NS_Parse_A_Data__External_Use extends
      _P_Parse_Data_A{
      //Data_B is locked local fot self namespace
   }

   //we even can create 2 different name spaces for external use
   public interface __NS_Parse_Data__External_Use_2 extends
      _P_Parse_Data_A,
      _P_Parse_Data_C{
   }
/**************************************************************/
   public interface __NS_Render_Data__Self extends
      _P_Render_Parse_Data{
   }

   public interface _P_Render_Parse_Data{
      static class Render_Parse_Data implements
         __NS_Render_Data__Self,
         
         //Parse namespace Adds for use
         __NS_Parse_A_Data__External_Use
      {
         static int IN_AA = Data_Object_A.IN_A + 1;
      }
   }

most funny its – I think that if I have Namespaces I may trim Classes Names
but irony - you can’t Wink
because if you have name "Parse_Seq"
trim it to "Seq" because its in Namespace Parse – is wrong and weird =)

but namespaces can help organize Code – but need refractor full project

p.s I also dreamed to have ability to add tags to functions – to organize it
let say you have set_Var for use with some checks
and same set_Var without checks – for Init class
add we already have such Tags XD
U_set_Var – for Use and
I_set_Var – for Init ^^

 7 
 on: 2017-06-23 04:16:25 
Started by BurntPizza - Last post by FabulousFellini
I pretty much finished my arcade cabinet!  Thanks for everyone who helped me a long the way.  Here's a video of me playing my game, with working sound and working controls and working everything  Grin

<a href="http://www.youtube.com/v/iktskeXOLnI?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/iktskeXOLnI?version=3&amp;hl=en_US&amp;start=</a>

 8 
 on: 2017-06-23 04:12:25 
Started by FabulousFellini - Last post by FabulousFellini
I ended up using TinySound and wow was that easy to implement.  I never really realized it would be so easy.  I learned how to use and ported all the java sound to tiny sound in about 2 hours.

@philfrei, I would still be interested in trying out AudioCue whenever you have it good and ready.  Thanks for helping me out with this!

 9 
 on: 2017-06-23 00:48:30 
Started by BurntPizza - Last post by NegativeZero
So a few of us from the IRC decided to enter [thecurrentyear] by making a Discord channel. We'll continue to use the IRC alongside it for the time being because programmers are stubborn some people like it, and if Discord goes tits-up we can just move back Smiley

https://discord.gg/VSyAXCB

 10 
 on: 2017-06-22 16:40:18 
Started by theagentd - Last post by Icecore
I'd just create buckets of items, and transfer items among buckets, which is cache friendly.

Its good concept – but its not so easy to implement as basic List
And about LRU cache
It sad, but it not help much – because Java hold pointer to object
And objects scattered all around random places on memory
So on iteration of array objects – it jumps around memory - its not cache friendly)

Remove remaining 98 000 objects using removeFirst():
    LinkedList: 0.298 ms
    FastLinkedList: 2.78 ms
and this result most likely because you use Call function - not direct element change like in LinkedList
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
public E removeFirst(){
     
      E h = head;
     
     
      E next = h.getNext();
      if(next != null){
         next.setPrevious(null);
      }else{
         //next and prev are null, list is now empty
         tail = null;
      }

      h.setNext(null);
     
      head = next;

      size--;
     
      return h;
}


LinkedList
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
private E unlinkFirst(Node<E> f) {
        // assert f == first && f != null;
        final E element = f.item;
        final Node<E> next = f.next;
        f.item = null;
        f.next = null; // help GC
        first = next;
        if (next == null)
            last = null;
        else
            next.prev = null;
        size--;
        modCount++;
        return element;
}

Pages: [1] 2 3 ... 10
 
Archive (336 views)
2017-04-27 17:45:51

buddyBro (534 views)
2017-04-05 03:38:00

CopyableCougar4 (977 views)
2017-03-24 15:39:42

theagentd (1012 views)
2017-03-24 15:32:08

Rule (992 views)
2017-03-19 12:43:22

Rule (972 views)
2017-03-19 12:42:17

Rule (968 views)
2017-03-19 12:36:21

theagentd (1069 views)
2017-03-16 05:07:07

theagentd (990 views)
2017-03-15 22:37:06

theagentd (759 views)
2017-03-15 22:32:18
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!