I tried improving my water by using a more complex algorithm, but it ran too slowly and I don’t know enough about shaders/math to fix it. So instead I tried a simpler approach of adding several layers of moving normal maps onto the basic wave vertex shader, which manages to run fast and looks half decent.
The last couple of days, I’ve mostly been doing non-Java stuff: I worked through the A-Frame School tutorial for web VR/AR. It looks like I might get a chance (paid) to write code for a gallery of 360-degree photos that allows a virtual tour of a local battleship. Will learn more about that gig on Thursday. Meanwhile, will continue brushing up on JavaScript and work through more of the “Guides” provided at the site.
A-Frame reminds me a lot more of how JavaFX works than Swing, that’s for sure. I’m glad I took time to get more acquainted with JavaFX.
If the contract is landed, I will stop accepting Java tutorial students through the online tutorial service I signed up with. Turns out it is possible to teach online and make a bit of side money. The competition is kind of steep though, as there are hotshots from all over also teaching. (One profile I saw: EE/CS “Cum Laude” graduate from Duke. And here I am with a Music Bachelors.) But they can’t all teach at the same time, and student requests sometimes come in clumps. So I’ve managed to accumulate about 25 hours of work over the last 6 weeks. Every little bit helps. (All my ratings have been 5-stars, so that helps!)
I can’t recall if I posted about finding a book “Digital Audio with Java” (Lindley) from 2000, at Half-Price Books. Over half the book is devoted to creating graphical interfaces PRE-Swing! But the algorithms that handle the actual processing are decent, and good starting points for rewrites. I made a Schroeder reverb a few weeks ago. The Lindley book references a truly standout book for learning about digital audio: Charles Dodge’s “Computer Music, Synthesis, Composition, and Performance” from 1997. This book does the best job of any that I’ve seen of teaching about digital audio.
Having the Schroeder reverb (similar to the Freeberb implemented by @nsigma, but configured slightly differently) has me working a bit (on and off) once again on real-time mixing of music from live synths and samples. This reverb is decent sounding if you don’t push it, but definitely has weaknesses for things like snare hits (can get a little “metallic”) or when mixed high (one can hear ringing). I’m reading elsewhere about a later development with another layer of feedback (term for it escapes me at the moment) that should be codeable when the time comes.
I have added a 3rd and 4th part to my tutorials which is a game from scratch basically, is there a better place for me to post these updates to?
Part 3 - improved Texture loading
Part 4 - Added hero class
Funny moment I accidentally find this one
I almost fell off my chair when i read this,
Because it’s one-o-one algorithm that i am developed in 2012 for terrain generation,
I have nothing to know about fractal generation, and terrain generation (at that time)
All I knew: Minecraft is using perlin noise,
I don’t want use it (because I have no idea how implement it)
and I want make something more realistic
so, I spend on it couple weeks or even month, trying out different ideas,
(upgrading my previous generation from 2011)
And I receive this:
http://s8.postimage.org/nyl4lxii9/Untitled_3.jpg
Here raw code img (if I made it today it may looks better ^^)
https://s1.postimg.org/v71xx3sd7/aaa.jpg
Simple imagine I also have random value to mix it in to result (because without it, it looks like waves)
same as in Diamond-square algorithm(that was developed from wiki in 1982)
p.s This is example why its not copy past or lame implementation: I have static parameter to set size of square at some size it can’t be divided by 2 in midle iteration like 3 / 2 for 8x8 square
So I made this:
if((MaxX - MinX) % 2 > 0){
MinX++;
}
int midlX = (MaxX + MinX) / 2;
why I even need to make square like 8x8 that have problems to divide middle parts?
- because I trying many options, searching best possible solution
//
And you saying, something about intellectual property rights and patents?
Its bullshat: random ppl in different parts of the world can implement same algorithms and technologies without knowing each others.
(and if “Diamond-square algorithm” was patented and I used something similar to it I may even lose in law court)
I thought I need a better way to keep track of what resources are in memory, and decided that Scene should be able to define dependencies on resources. To make this easier, I thought I might define a DSL. So here is it:
public static class LevelResourceTable extends ResourceTable<Resource>
{{
texture(Resource.PLAYER, FilePath.getResourceFile("player.png"));
texture(Resource.ENEMY, FilePath.getResourceFile("enemy.png"));
texture(Resource.SKY, FilePath.getResourceFile("sky.png"));
}}
Where Resource is a simple enum. I can then simply let the scene declare the dependencies. I’d be having different tables like these, and scenes will be declaring them as:
public class Scene1 extends Scene
{
@Override
public List<ResourceTable> getDependencies()
{
return Arrays.asList(
new LevelResourceTable(),
new GlobalResourceTable()
);
}
}
I’m still thinking of an even easy method of having returning the dependent resource tables from a scene. Seems Java can have the beauty of these DSLs right?
I made some very simple procgen trees which sway around individually in the wind gusts, and some slightly creepy triangular people.
I finally reconnected to the git project SiVi, yesterday. Haven’t done an update since 2014! Today, was playing around with “fixing” a couple things–wanted to have the channel outputs and master on the mixer display numbers that were easier to use/more informative. While changing that (have yet to upload changes back to the project), I took a little time to play with the “gif making” tool. This one is about 44MB.
http://hexara.com/Images/rings3.gif
Also, played a bit with Glitch and A-Frame, and loaded SiVi-generated png graphics to see if they would work as textures:
http://hexara.com/Images/trio.jpg
I’m hiding the border lines (rotated away). I think I can use a variant of the algorithm similar to what is being used to “wrap” the gifs into smooth loops to make the edges of the texture graphics meet up smoothly. Looking forward to having time to test that out.
Stuff I’ve done in last week
-
Taking a break from game dev.
-
Started working a MS Paint clone for more GUI and MVC experience. Also, creating productivity software helps learn how to use other productivity software quickly.
Learned about Robot and Desktop class. Definitively learned the difference between actions and actionlisteners. Extremely irritated that some Actions I programmed were already accessible by clicking the top left of a JFrame (i.e. Move, Minimize, Maximize, etc.).
I have absolutely no idea how I am going to reproduce the ribbon. -
Finished 4 animes: New Game S1, Seisen Cerberus, Tanaka-kun wa Itsumo Kedaruge, Bungou Stray Dogs S1.
-
Finished 2 games: Anna’s Quest and Children of Zodiarcs. Still haven’t managed to quit LoL.
-
Cooked my biggest meal ever: Blackened Tilapia, Bean Salad, and Banana Bread (Cooking Time: 1:30)
-
Started reading 2 books on Python and Perl (made by some “special” people). Keep procrastinating reading this Javascript book.
-
Finished my IT internship. Now off to my last year of undergrad. Hopefully I can continue my daily reading, gaming, anime watching, and programming alongside my part-time job and school.
I re-designed astimefades.com in anticipation of our first EP! Still working on it, but I’m pretty happy with it so far. Also I used NodeJs, Mongo and EJS to build out the new site! Crazy to be moving away from good old Java + Spring Boot If anyone wants to go check it out and leave feedback that would be great!
Here’s a screenshot:
Worked on more games fpr my games-calendar. At the moment: 15 games are ready. Here you can see some screenshots of the games
Why you must never use float with sensitive data
(it’s literally everything except img, audio out, and maybe AC out)
float fff_1 = 65536.0f;
float fff_2 = 0.0039f; // or 0.003f
float fff_3 = fff_1 + fff_2;// = 65536.0f == fff_1
/**
65536 = 65535(2 byte) + 1(1 byte) = 3(byte)
1 / 256 (1 byte) = 0.00390625
0.0039 (2 byte) - because its less 0.00390625 (8 Bits accuracy)
3(byte) + 2(byte) = 5(byte) and float have only 4(byte)
*/
float fff_4 = 65536.0f + 0.00390626f;// 65536.01
float fff_5 = 65536.0f + 0.00390625f;// 65536.0
You even can’t epsilon compare it because its 3 digits after zero.
Icecore, I am not sure you understand how the float data is stored. To get a float number from the 4 bytes you use the below
First bit s for sign
Next 8 bits x for the exponent
Next 23 bits m for the mantissa
(2^(x−151) ) (1−2s)(m+2^(24))
The point is it’s single precision “floating point” (da dum tish!). You have 24 significant bits and there you have it. Notions of “epsilon” seem to add more confusion than clarity.
When you receive this:
float fff_5 = 65536.0f + 0.003f;
float fff_6 = 65536.0f + 0.001f;
float e = 0.0001f;
if(Math.abs(fff_5 - fff_6) >= e){
System.out.println("not same");
}
else{
System.out.println("same");
}
fff_5 = 65535.0f + 0.003f;
fff_6 = 65535.0f + 0.001f;
if(Math.abs(fff_5 - fff_6) >= e){
System.out.println("not same");
}
else{
System.out.println("same");
}
wiki data about “Single-precision floating-point format” can’t save you or help solve problem)
FV:0.001 Hex:3a83126f Bits:111010100000110001001001101111
FV:0.003 Hex:3b449ba6 Bits:111011010001001001101110100110
FV:65535.0 Hex:477fff00 Bits:1000111011111111111111100000000
FV:65536.0 Hex:47800000 Bits:1000111100000000000000000000000
FV:65536.01 Hex:47800001 Bits:1000111100000000000000000000001
FV:65535.004 Hex:477fff01 Bits:1000111011111111111111100000001
only double fix it =)
p.s And yes i know that float part in 65536 is not 1 byte(8 Bits) its 7 bits
and when integer data grow float part is decreased not by bytes but by bits
(on top post was raw example ^^ because no one cares this bits magic unless it solves the problem and it doesn’t =))
FV:65535.004 Hex:477fff01 Bits:10001110111111111111111_00000001
FV:65535.996 Hex:477fffff Bits:10001110111111111111111_11111111
FV:65536.01 Hex:47800001 Bits:100011110000000000000000_0000001
FV:65536.99 Hex:4780007f Bits:100011110000000000000000_1111111
FV:65537.0 Hex:47800080 Bits:100011110000000000000001_0000000
FV:65537.01 Hex:47800081 Bits:100011110000000000000001_0000001
Looking at it that way doesn’t seem useful. For singles we have the 24 most significant bits so looking at in hex format and showing all 24 bits and aligning the decimal point gives (the ‘-’ are bit positions beyond 24):
65536.0 0x1p+16 10000000000000000.00000000------ 0.00300 0x1.89374cp-9 .00000000110001001001101110100
So even the highest bit of 0.003 is too small to contribute (by one) so: 65536.0+0.00300 = 65536.0
If we were to multiply that by two and then add then it could:
65536.0+2*0.00300 = 65536.007812 = 0x1.000002p+16 = 10000000000000000.0000001
The exponents from the first are +16 and -9, so 16-(-9)=25 so too large a gap to contribute.
I was thinking more about concept of float structure,
In theory format may use only max 8 bits float part(with 0.0039 tick) and 4 bits exponent its adds more integer data to use
But he was design in different way – so it hold as many float part as he can.
And after more thinking I suddenly find explaining why)
Because it was designed to return div accurate result
– and not for holding big value)
This is a purpose of float and not to hold 300000.005f =)
int a = 100000;
int b = 100001;
float f = (float)b / a;//1.00001
int c = (int) (f * a);//100001
if(c == b)System.out.println("same");
else System.out.println("not");
Still working through LibGDX tutorial series: https://carelesslabs.wordpress.com/2017/08/14/making-a-libgdx-roguelike-survival-game-part-9-screen-shake-inventory-gamedev/
Next will go through progressing an inventory system.
I spent another day messing around with my water and lighting. Fixed up the sun light to allow for seasonal rise/set time and angle variation, which helped improve the coloring.
It is so beautiful!!!