Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (690)
Games in Android Showcase (200)
games submitted by our members
Games in WIP (764)
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 ... 14
1  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-09-25 11:51:58
Find this:
How To Start Your Game Development:
its video playlist
https://www.youtube.com/watch?v=z06QR-tz1_o&list=PLhyKYa0YJ_5BkTruCmaBBZ8z6cP9KzPiX&index=7
2  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-09-23 20:39:21
What I meant is the fact that the new methods just points to the deprecated one, and that just sounds plain cheap.
=)
java.awt.Polygon was created in 1.0
in 1.2 it Implementing Interface Shape
Shape have getBounds
getBoundingBox can't be removed or rename by legacy support ^^

https://docs.oracle.com/javase/7/docs/api/java/awt/Polygon.html
https://docs.oracle.com/javase/7/docs/api/java/awt/Shape.html

getBounds and getBoundingBox
have same code, do you really want duplicate it?

Yes this looks better
1  
2  
3  
4  
5  
6  
7  
8  
public Rectangle getBounds() {
    // snipped, irrelevant
}

@Deprecated
public Rectangle getBoundingBox() {
    return getBounds();
}

but in any case it devs decision how separate code

p.s and even Open source Java have many bugs (not this small code style mistakes)
same as other big companys products - its natural
3  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-09-23 20:17:04
Now I get that the second method is probably deprecated in order to change the name but... I wonder if the entire source code is full of examples like this? persecutioncomplex
Sometimes you can't change name because of legacy)
and
getBounds();
is part of
Shape interface
4  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-09-21 13:03:49
Interesting video:

https://www.youtube.com/watch?v=A5Xv0p0dm8E

In case 60 min video is long for you:
Guy works for Microsoft 15 years was fired in 2014 with thousand other ppls
And now have own popular youtube channel
(Because Microsoft dismiss “Test department” so all testing do End Users XD)

up:
IMHO:
So as you understand after dismiss Test department in 2014
all Microsoft product have Unstable patch’s and release’s ^^

It so strange that it happen in same time,
as some ppl decide that: “trow away $2.5 billion in a window” is smart decision,

I can’t say that these events are interconnected,
but $2.5 billion did not appear out of thin air,
And 18000 people has been fired Sad
(ppl’s that work many years for company)
5  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-09-20 22:08:56
Makes me happy, found this Smiley

Creating a 4D World: The Technology behind
<a href="http://www.youtube.com/v/vZp0ETdD37E?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/vZp0ETdD37E?version=3&amp;hl=en_US&amp;start=</a>

so similar to my old article
http://www.java-gaming.org/index.php?topic=29604.0

p.s and no he not use my idea, he have working prototype in 2009, we simple try some same crazy idea ^^
6  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-09-17 18:51:43
I expect 2000 installs on the morrow*
Even if all Active Java-Gaming users install it will still don't be even 1000 Sad

* Unless somehow you're one of those Apple people, in which case a) WHAT ARE YOU DOING IN HERE and b) you'll have to wait a couple more days
Or my device is Android 2.3 Tongue
(I even not sure if it can give stable 30 Fps for such cool graphics ^^)
7  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-09-16 18:48:35
Its old discriminating game Tongue
Why I can have only 1 Lover?
And one Job…
Why i can't convert Friend to lover?
and many other discriminations
8  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-09-15 08:34:41
I got depressed a bit.
http://xkcd.com/1732

I think increasing 3-6 degree of temperature is smallest that will bother you
When you be swimming in trash and eating food grooved on trash, breathe dirty air filled big count CO2

http://factmyth.com/factoids/there-is-a-plastic-garbage-island-in-the-ocean/
http://blog.theraceison.co.uk/index.php/2011/08/15/how-space-junk-is-destroying-our-planet-from-above/
and mass felling of trees near you

But like always humanity find way and start build Biodomes ^^
(for rich of course)
9  Game Development / Newbie & Debugging Questions / Re: manipulating SourceDataLine on: 2016-09-14 18:29:58
I'm pleased with the results. I think the only thing I can do now is go into Audacity and get those edits juuust right...

Major thanks to @philfrei and @Icecore for their willingness to share knowledge and expertise!
 
You're welcome

That's explains a lot, but can somebody pleased explain to me why the block is synchronized on sdl, and not ais or ais_swap?  Huh
Because ais and ais_swap is changed by both threads during synchronize

This how it works “Raw explain”:
Every object have boolean value –
is_synchronized


When Thread enter synchronized block
Thread check
1  
2  
3  
4  
5  
6  
if(is_synchronized){
wait
}
is_synchronized = true;
on leave block
is_synchronized = false;


null object don’t have any Object data
and for changeable object
you have
obj1, obj2

Thread1 synchronized(obj1)

then swap links
obj1 = obj2 

Thread2 try use synchronized(obj1)
and shi use it, because
Technically obj1 is different object hi have
is_synchronized = false

Even when Thread1 still in synchronized block above

I also reread about
drain
you can use it only on Thread stop
Drain = wait, until all written data - played to end
It prevents clipping sound on Force thread Stop, but don’t have any result on filling new data to buffer
10  Game Development / Newbie & Debugging Questions / Re: manipulating SourceDataLine on: 2016-09-14 10:22:22
1) Convert the byte data to PCM values (very likely to -32768 to 32767 range if 16-bit data).
2) Add the values from each input (and check to prevent going out of range).
3) Convert back to byte data and ship it out.
I'm not sure about step 2 Smiley
Yes it works and almost everyone use it, but is it right?
Its same as Add 2 Red colors bytes, when you must add luminance of colors...

I’m interesting if record audio from mic between 2 instruments that play one Note
How sound changes?
I doubt that simple multiply Hz of played note on 2.
At least it must be some exponential Curve for Raw adding,
But for more clear it must be something Like LAB space in Color

up find this:
http://atastypixel.com/blog/how-to-mix-audio-samples-properly-on-ios/
http://www.voegler.eu/pub/audio/digital-audio-mixing-and-normalization.html

little offtop:)
Warcraft II - Tides of Darkness - Human 2 Midi
https://www.youtube.com/watch?v=GU7UWhPn-pQ
https://www.youtube.com/watch?v=V_FYOI91eLE&list
11  Game Development / Newbie & Debugging Questions / Re: manipulating SourceDataLine on: 2016-09-14 10:03:03
For synchronization you need any non changeable(not null) object that you can access from 2 threads
https://docs.oracle.com/javase/tutorial/essential/concurrency/locksync.html

I use sdl like example – because in many cases you don’t want create new SourceDataLine object in Audio thread.
But to make code clean better create separate syn object
1  
public static final Object Syn = new Object();

Using Direct synchronized from another Thread its rude, same as static Syn object,
but for raw example its ok, and it works just fine

but I'm not seeing why synchronization is needed.
Its prefers for using Sync, i show why:
1  
2  
3  
4  
5  
6  
7  
8  
//Thread 2 set ais_swap
if(ais_swap != null){//Thread 1
   //Thread 2 set ais_swap = null
   //but Thread 1 already pass null check
   ais = ais_swap;//Thread 1 ais = null;
   ais_swap = null;
   swap = true;
}

Yes its rare, very rare but you can simulate this in debug mode
(stop threads, step line by line for 1, 2 Thread as you want)
synchronized block Prevent this.
12  Game Development / Newbie & Debugging Questions / Re: manipulating SourceDataLine on: 2016-09-13 22:22:58
Forgot add IO check)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
while(true) 
   boolean swap = false;
   synchronized(sdl){
      if(ais_swap != null){
         ais = ais_swap;
         ais_swap = null;
         swap = true;
      }
   }
   nBytesRead = ais.read(data, 0, data.length));
   if(nBytesRead < 0){
      break;
   }
   if(swap){
      sdl.drain();
   }


Technical you can mix audio in Byte Array befor send it
but I have no idea how mix "byte Audio data" )
(I believe simple + 2 data's is wrong)
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-09-13 21:42:54
I got depressed a bit.

http://xkcd.com/1732
I think the fact people still don't believe this is insane , it's obviously getting worse and population increase plays a huge role! Us java developers need to get into gear to make games that stop people from wanting to have more children so that we can save the environment!
I think more reliable way will be eliminate humanity ^^
(Like true programmers we must fix problem rather than hide bugs XD)
or build many walls Tongue
14  Game Development / Newbie & Debugging Questions / Re: manipulating SourceDataLine on: 2016-09-13 21:07:28
However, looping the SourceDataLine requires draining and closing the old DataLine, shutting down the thread, starting the new thread, and creating, opening, and starting the new DataLine.
Who say you this?)

as i said
then you can send any data in any order as you want to SourceDataLine

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  
//Thread 1
AudioInputStream ais_swap = null;
while(true)
   synchronized(sdl){
      if(ais_swap != null){
         ais = ais_swap;
         ais_swap = null;
      }
   }
   nBytesRead = ais.read(data, 0, data.length));
   offset = 0;
   System.out.println(name + " reading...");
   while (offset < nBytesRead){
      System.out.println(name + " writing...");
      offset += sdl.write(data, 0, nBytesRead);
    }
   if(killThread){
      System.out.println(name + " killing...");
      break;
   }
   System.out.println(name + " reading...");
}
//Thread 2
   synchronized(sdl){
      ais_swap = new AudioInputStream
   }

*if AudioInputStream's have same AudioFormat

Perfect will be after swap - drain previous data
- but this step can be skipped because it's coupl MS time of sound before swap new track
***
byte[] data
SourceDataLine depends only on AudioFormat it dont care what data you write in

p.s Auido in java is hard - MIDI even harder
Easiest way – try change exist “audio tutorials code” as small as possible Wink
15  Game Development / Newbie & Debugging Questions / Re: manipulating SourceDataLine on: 2016-09-13 10:50:24
"SourceDataLine" is works like Data buffer
https://docs.oracle.com/javase/7/docs/api/javax/sound/sampled/SourceDataLine.html
it have size depend on "AudioFormat"
FormatSize * channels == time (1 sec or ms not remember sure)

so you need load file "wav"
offset header data (header data needed for creating AudioFormat)
then you can send any data in any order as you want to SourceDataLine

simple remember: to not broke this loop - its important to be so (because of multy thread)
1  
2  
3  
while (offset < nBytesRead){
   offset += sdl.write(data, 0, nBytesRead);
}

up:
i reread comments about SourceDataLine.write
and remembered that hi blocked thread until fill full data so “while” in theory can be skipped
16  Discussions / Miscellaneous Topics / Re: CuBBool Pixel language on: 2016-09-12 15:25:25
- in some way its even better then QR codes because you can decode text manually

If it were better than QR-Codes, it'd have some form of error correction. Does it?
It's chars:)
what error corection you want in chars?)
Simple paint it bigger size so 1 pixel become 4x4
Or you can add same check_sum or correction data in finished text Block)

IMHO:QR codes is Scam everywhere except official documents papers
Don’t be surprised if after scanning random code on street you’r phone be infected by malware

up:
http://blog.qr4.nl/page/QR-Code-Data-Capacity.aspx
Do you know that for 29x29 pixels(841 pixels) QR have only 208 bits of data With error corecton 30%
paint 4 same imgs 15x15 (225 pixels) in cube 30x30 and you receive 75% error correction Roll Eyes

up2:
QR codes newer was design to be public stuff  - it was created as for “only in company usage“  Clueless
like some fast madden software to optimize production process (with terable GUI ^^).
Small change like add more colors – let say 6 can increase Data capacity of Code in ~6 times Tongue

All knew that – but all don’t care XD
17  Discussions / Miscellaneous Topics / Re: CuBBool Pixel language on: 2016-09-12 15:00:16
Can I ask what are your motivations for doing this?
First I want make smallest readable font as possible, so I make this encoding for fun
But after I finish it
it looks so cool (have full chars encodings with Extra symbols)
–even better then https://en.wikipedia.org/wiki/Braille
(its even harder with “Braille multy languages")

If separate pixels for dots even noob can read it after explaining:
–transfer data to decimal, find char in Alphabet
-because chars have bounds writer don't need to make holes - only dots.

+its Bits math - easy to understand(calculate, generate) and decode (From img)
Easy to predict next letter (not like next pixel img after ‘A’  become pixels ‘B’ )

+semi chars size (even XY size can be align same)
+multi usage – any language can be added: even chinese (in bigger matrix)

-in some way its even better then QR codes because you can decode text manually

p.s It looks like language from cyber future XD
18  Discussions / Miscellaneous Topics / Re: CuBBool Pixel language on: 2016-09-11 14:09:52
Don't know what to do with spacing between chars:
For 6 x 6 (on imgs up)
I used 4 pixels for X space and it looks ok, 1-2 pixels for me blends text
For Y - i try 2 pixel and it looks ok
So 6 x 6 char become
10 x 8 pixels

Comparing to Green chars (LucidaTypewriterRegular" S = 12)
Its 8 x 15 pixels in text, can be Trimmed (between spacing chars without harm visual)
to 7 x 14

Smallest readable Font i find out is (LucidaTypewriterRegular" S = 9)
6 x 11 Trimmed
to 5 x 10

up:
You can ask What difference? pixel smaller – pixel bigger..

Let say you have Window 700 pixels Y
7 x 14 = 50 Text (code) lines Y  - Base
5 x 10 = 70 Text (code) lines + 40%
10 x 8 =  87 Text (code) lines + 74%
10 x 7 =  100 Text (code) lines + 100%
19  Discussions / Miscellaneous Topics / Re: CuBBool Pixel language on: 2016-09-11 13:23:37
Different color may be used for better performance


for multi language support, in one text, with small matrix
- can be colored any Non Data Bits group ("Always_On" or "Layouts").

That allow change encoding on fly - with any Data(Text) color blending
20  Discussions / Miscellaneous Topics / Re: CuBBool Pixel language on: 2016-09-11 12:52:42
Also some crazy Geeks can Use something like this:
1  
2  
3  
##0
###
###

11111
Number = 31
21  Discussions / Miscellaneous Topics / CuBBool Pixel language on: 2016-09-11 12:28:04
CuBBool #CuBBool
(reads with one ‘B’ – “cubool” or “cubol” )
From: Cube and Bool

Benefit – Smallest Char is 3 x 3 pixels Wink (+1 offset between chars = 4 x 4)
For other languages can be used matrix 4 x 4 or even 5 x 5
5 x 5 – even enough for big portion of Unicodes


!<%$.,'"|\^(/:);-_?~>@+*=[&{]#}


!<%$.,'\"|\\^(/:);-_?~>@+*=[&{]#}



its not random dots
3 x 3 have 5 Data bits
Bits order: from Left to Right, from Top to bottom

123
45
so for char: ''a' (00000), ''b' (10000), ''c' (01000), 'd' (11000), 'e' (00100)

For numbers and letters I use alphabetic progression
Because numb & letters frequently used, with time(used) you remember them
But with remembering symbols can be problems
So i try sort them by ”Visual”.

Secret: extra "Space" char:
it looks like arrow Right / Bottom
1  
2  
3  
#00
00#
0##


p.s Can be Used By anyone and anywhere,
Intellectual property for language? - lol XDDDD
22  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-09-11 01:35:09
Create Own encrypt language for fun XD
CuBBool
(reads with one ‘B’ – “cubool” or “cubol” )
From: Cube and Bool
Because Cube Dot looks stupid ^^

Benefit – Smallest Char is 3 x 3 pixels Wink (+1 offset between chars = 4 x 4)
For other languages can be used matrix 4 x 4 or even 5 x 5
5 x 5 – even enough for big portion of Unicodes


up: And yes, CuBit from Cube & Bit already in use Wink
up2: swap numbers and small letter layouts - for better visual ^^

pp.s its not random dots
3 x 3 have 5 Data bits
Bits order: from Left to Right, from Top to bottom

123
45
so for char: ''a' (00000), ''b' (10000), ''c' (01000), 'd' (11000), 'e' (00100)

For numbers and letters I use alphabetic progression
Because numb & letters frequently used, with time(used) you remember them
But with remembering symbols can be problems
So i try sort them by ”Visual”.

up4:
someone may need "space" char Wink
Secret: extra "Space" char:
1  
2  
3  
#00
00#
0##

(move it to small letter layout in looks like arrow Right / Bottom)

HashTag ^^ #CuBBool

For Separate Discussions:
Create Thread http://www.java-gaming.org/topics/cubbool-language/37737/view.html
23  Games Center / Android Showcase / Re: Morrowind on Android on: 2016-08-24 19:04:36
Gigantic Work.
I want help a little with optimization..

But why only I, We all can ^^,
Find what lagging the most, separate it from engine - and create thread here
we all try hard to find solution how improve it Wink

(“separate it from engine” - I think full engine source code not ready be revealed for public)

P.s optimization - Except external libraries like Jbullet and Java3D Tongue
PP.S Sorry I Over excited about all this
(because my Pc can’t run fallout 4 and you run it on Adroid XD)
this optimization on practice can be no so easy as it looks for me now.
At least we can try)

up:
Do you use this?
ElderScrollsExplorer/shaders/land.frag
It scares me)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
void main()
{
    vec3 ct,cf;
    vec4 texel;
  //  float intensity;
  //  intensity = max(dot(lightDir,normalize(normal)),0.0);
 
   // cf = intensity * (gl_FrontMaterial.diffuse).rgb +
   //               gl_FrontMaterial.ambient.rgb;  
   cf = (gl_FrontMaterial.diffuse.rgb +
                  gl_FrontMaterial.ambient.rgb)/2.0;  
                     
    texel = texture2D(tex,gl_TexCoord[0].st);
    ct = texel.rgb;
    //alpha is material only
    gl_FragColor = vec4(ct * cf, gl_Color.a);
}

as i understand diffuse and ambient can be pre mixed together with texture and save to file
no need do it in shader directly
- if it used really for all lands this shader can easily split FPS for half or even more

even if ambient dynamically changed in game
- it can be baked on every change in real time to texture and use that texture without mixin in shader directly

gl_FragColor = vec4(ct * cf, gl_Color.a)

external gl_Color.a Why? for debug? i don't remeber game mechanics with custom walls transperancy Wink
24  Discussions / Miscellaneous Topics / Re: What I did today on: 2016-08-21 20:18:32
"There's no place like 127.0.0.1"
Ou  Sad, i thought 127.0.0.1 is my Home  Tongue
25  Discussions / Miscellaneous Topics / Re: There is no hope on: 2016-08-21 13:10:42
Browsing the Gogle Play store, I saw this comment about someone's game:
Quote
Its a nice game but why we have to purchase with real money?
And he right (don't want explain- simple: "now - is wrong time")
Make free game with 5 lvl
and more lvl for money - Problem solved)

p.s And if he ask why "we have to pay real money for more lvls"
Facepalm him XD
26  Game Development / Performance Tuning / Re: Tips for reducing frame rate spikes due to JIT early in a game? on: 2016-08-12 16:24:17
warm-up spikes can be fixed with JVM start arguments, (custom build ^^)
Try this:
1  
2  
-server
-XX:+DoEscapeAnalysis

+maybe search more in docs

up: it also may be caused by static fields initialization (new static array list 1000) - in middle of frame
can be fixed by calling all - heavy static data classes - in init phase
27  Game Development / Game Mechanics / Re: [libGDX] Scanlines problem with OrthographicCamera on: 2016-08-03 14:08:37
You said using opengl in libgdx is new for you, why don't you copy every bit that is needed to run this example into your game and see if it does anything, skipping steps without understanding whether you can skip them is asking for trouble.
Agree - clean Opengl very sensitive to every mistake:
you turn on some parameter(status) - forgot send data to it (or send wrong data count 9 from 10)
and receive black screen - without any warning or debug errors.

So best way copy-past 100% working examples and line by line figurate out how they works,
and re run it after every line editing to catch moment when all goes wrong Wink
28  Game Development / Game Mechanics / Re: [libGDX] Scanlines problem with OrthographicCamera on: 2016-08-02 16:41:49
I think you mess up with colot count
i may be wrong ), but try default 4 floats colors without packing
https://github.com/mattdesl/lwjgl-basics/wiki/LibGDX-Meshes-Lesson-1
29  Game Development / Game Mechanics / Re: [libGDX] Scanlines problem with OrthographicCamera on: 2016-08-01 17:36:57
Make biggest texture you need let say 2000 pixels Height,
if you have device with 1000 pixels set Texture UV 0.0 - 0.5
30  Game Development / Performance Tuning / Re: [libGDX] Can this small scanlines GLSL shader be further optimised? on: 2016-07-31 20:22:14
You can try draw on top of game - scanline texture with basic GL blend options
and move texture by texture matrix, or swap it like animation

p.s 25-30 fps for mobile - is ok
IMHO: Img looks brain eating.
but many companies use this standard
Pages: [1] 2 3 ... 14
 
xTheGamerPlayz (27 views)
2016-09-26 21:26:27

Wave Propagation (230 views)
2016-09-20 13:29:55

steveyg90 (343 views)
2016-09-15 20:41:23

steveyg90 (342 views)
2016-09-15 20:13:52

steveyg90 (381 views)
2016-09-14 14:44:42

steveyg90 (408 views)
2016-09-14 14:42:13

theagentd (437 views)
2016-09-12 16:57:14

theagentd (370 views)
2016-09-12 14:18:31

theagentd (297 views)
2016-09-12 14:14:46

Nihilhis (729 views)
2016-09-01 13:36:54
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
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!