Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 196 197 [198] 199
  ignore  |  Print  
  What I did today  (Read 2498197 times)
Spasi and 8 Guests are viewing this topic.
Offline abcdef
« Reply #5910 - Posted 2018-03-13 13:44:17 »

Got distracted building my ui interface, in my quest to get a rounded rectangle I ended up building a new vector graphics engine which has a nice triangulation routine to triangulate any shape (convex, concave, single hole, many holes). Also allowed me to do some nice gradient shading / texturing on any shape.

I'd be very interested if you'd like to share that code! Smiley


It's hard to give you access to all the code but I can tell you the general principals

1) The triangulation for the filling of the shapes was based on "Sweep-line algorithm for constrained Delaunay triangulation" by V. Domiter and and B. Zalik
2) The stroke drawing was just basic LINE_LOOP of the various contours provided
3) The drawing of shapes was done using a similar api that we go uses but adapted to be easier to use in my opinion. you have a shape which can have many closed contours, you can line to somewhere, beside to somewhere, create circles, ovals, rectangles, rounded rectangles etc.
4) This data feeds the algorithm and you get a list of triangles finding out which uses all your point (nomore are created).
5) when you get the triangles I find a bounding box then calculate texture coordinates for all points and then use this for filling with either a texture, a single colour or a gradient colour.
6) I don't have anti aliasing yet but will add later one I have built all my ui components
7) my ui components can be drawn with the vector api

That's basically it, it looks pretty cool and you have lots of holes in a shape and it textures perfectly around it
Offline Longarmx
« Reply #5911 - Posted 2018-03-15 17:21:24 »

The last couple days, I added global variable support and while loops to a compiler I've been working on. It compiles a "miniC" language to mips32. So, this code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
// Declare and assign variables
my_var = 2;
counter = 10;
// Perform some operations
while(counter = counter - 1) {
    my_var = 2 * my_var;
}
// Print it out
print my_var;

compiles to this:
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  
.data
counter: .word 0
my_var: .word 0
.text
li $t1 2
la $s1 my_var
sw $t1 0($s1)
li $t2 10
la $s2 counter
sw $t2 0($s2)
while_top_1:
lw $t3 0($s2)
li $t4 1
sub $t3 $t3 $t4
sw $t3 0($s2)
beq $t3 $zero while_end_1
addi $sp $sp -4
sw $t4 0($sp)
li $t4 2
lw $t5 0($s1)
mul $t4 $t4 $t5
sw $t4 0($s1)
j while_top_1
while_end_1:
addi $sp $sp -4
sw $t5 0($sp)
lw $t5 0($s1)
li $v0 1
add $a0 $zero $t5
syscall
li $v0 11
li $a0 10
syscall

and prints
1024

This has been a really exciting project so far. If you want to view the code, here is the github.

Offline theagentd
« Reply #5912 - Posted 2018-03-18 01:05:15 »

Had my last uni exam today. Now I only have one more left this summer and I'm done with uni.



Decided to have some fun and coded a super simple ok, maybe not that simple Falcon 9 FT rocket launch simulator in 2D. I've inputted the following data in SI units:

 - Earth's radius and mass
 - Earth's rotation and the "bonus" horizontal velocity gotten by launching from Cape Canaveral
 - Earth's atmospheric density approximated with an exponential function of height over ground

 - Target orbit altitude (400 000m Low Earth Orbit, just under the ISS) and the exact velocity needed to maintain that orbit

 - Rocket drag area (circle of radius 2.6315m) and approximated drag coefficient (0.25)

 - The following parameters for the two Falcon 9 FT stages:
    - Weight without fuel (22 tons, 4 tons)
    - Weight of fuel (410.9 tons, 107.5 tons)
    - Thrust (~8 000 000 N (actually 7 607 000 to 8 227 000 depending on altitude), 934 000 N
    - Burn time (162 sec, 397 sec)



The rocket is then assumed to rotate from 0 to 90 degrees over the course of the flight (you never want to point a rocket downwards or you will not go to space today), and this rotation is controlled using a Taylor series controlling the rotation. This allows the rocket to rotate at different rates at different parts of the flight. Basically, this allows the first stage to go more straight up to quickly get out of the thickest part of the atmosphere, and then quickly rotate over to the side to gain orbital speed as efficiently as possible. The Taylor constants are decided using a simple learning algorithm that tries to get rid of the error in altitude and orbital speed/direction. However, if the thrust is simply too high, the rocket will get a too high orbital velocity, so I also added the payload weight as a parameter, so if the rocket overshoots, I just add more weight to it. Also, the rotation of the Earth is taken into consideration, and the drag is calculated (approximately) based on the idea that the atmosphere rotates with the planet (so the rocket starts out travelling at around 408m/s together with the surface, but has zero drag since the air is rotating too).

The learning algorithm just tries random modifications to the taylor constants and the payload weight and checks if the result is a better end orbit than before (= lower error in altitude and orbital speed/direction), and given time it converges on the perfect settings for launching the rocket. After running the program for around 10 minutes and changing the learning rate as it went, I got the calculated error down:
 - -9.909272E-7 meter error in altitude
 - 6.1378614E-8 m/s error in velocity away from the Earth
 - -1.3683348E-8 m/s error in orbital velocity

In other words, the resulting orbit is off by less than a micrometer, and the velocity is off by even less than that. The maximum payload was determined to be 21843.23 kg, which is a bit lower than the payload the Falcon 9 FT is rated for, 22 800kg payload (possibly plus 1 700 kg, not sure if those 1.7 tons are included in the 22 800 number), but at least close enough to be in the same ballpark. Considering it's a 2D simulation I made with information I could Google in a couple of minutes, it's pretty cool.

Image of the trajectory:



The curve at the start comes from the fact that the planet is rotating, so the rocket starts with a high speed to the left but accelerates upwards. The color of the trajectory shows the two stages and how they deplete their fuel (which of course causes the rocket to get MUCH lighter over the course of the flight). Once the first stage is depleted, it instantly switches to stage 2 at which point stage 1 is jettisoned and no longer adding weight to the rocket. It would be possible to add a zero-thrust stage inbetween to add some time for the stage separation. No, the first stage doesn't fly back and land. =P



Some people go out drinking to celebrate, I write rocket simulations...

Myomyomyo.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Longarmx
« Reply #5913 - Posted 2018-03-18 01:18:34 »

No, the first stage doesn't fly back and land. =P

Ah, but that would be quite fun to watch the simulation calculate the first stage's trajectory!

Also, how many terms are in your Taylor expansion? And do you just evaluate it with a time since launch or some other variable?

Offline theagentd
« Reply #5914 - Posted 2018-03-18 01:50:25 »

Also, how many terms are in your Taylor expansion? And do you just evaluate it with a time since launch or some other variable?
I used 8 coefficients there, but even 3 can sometimes suffice; it depends on the parameters of the simulation. Yeah, I calculate x = (1 - currentTime/totalTime), use x, x^2, x^3, etc with the taylor coefficients and finally do angle = (1.0 - sum) * Math.PI/2 to get the thrust angle. Since my only real requirement is that the sum is 0 at the start and 1 at the end, I just make sure that the coefficients sum up to 1.0 and that handles it.

Myomyomyo.
Offline FabulousFellini
« Reply #5915 - Posted 2018-03-18 18:03:06 »

I got an isometric tilemap working.  I dunno why the camera cuts off the bottom sometimes but I'll figure it out. 

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

-FabulousFellini
www.fabulousfellini.com
Offline nsigma
« Reply #5916 - Posted 2018-03-20 10:09:37 »

Well, strictly speaking yesterday's fun hack - decided the Electron framework wasn't bloated enough so added a JVM into the mix!  Grin

Apache NetBeans HTML4J and Dukescript examples running on the JVM and rendering in an Electron Chromium window.


Praxis LIVE - hybrid visual IDE for (live) creative coding
Offline philfrei
« Reply #5917 - Posted 2018-03-20 19:08:42 »

First ever receipt of a donation for software I posted on GitHub, this morning!

music and music apps: http://adonax.com
Offline chrislo27
« Reply #5918 - Posted 2018-03-21 03:26:29 »

It's been a really long time since I've returned to this site. Always good to see familiar faces while browsing around!

I guess for what I did today, I released v3.8.0 of the Rhythm Heaven Remix Editor. Nothing much; it's just a side project I work on using Kotlin and libGDX. (Many people have told me how bad of an idea it was to use libGDX for a UI-heavy program, and I fully agree with them! Grin)

Anyways, I hope to poke around again sometime. If I ever get back into game dev I'll be sure to help out where I can!
Offline nsigma
« Reply #5919 - Posted 2018-03-21 11:16:15 »

I guess for what I did today, I released v3.8.0 of the Rhythm Heaven Remix Editor.

Looks great!  Good seeing projects shipping with libraries I wrote too.  Not that you seem to be using them!  Wink

Praxis LIVE - hybrid visual IDE for (live) creative coding
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline cygnus
« Reply #5920 - Posted 2018-03-22 02:07:50 »

After many months of redoing and reworking systems to make them easier to use, I have finally got resource nodes (points on the level where resources are inputted or outputted) and block templates working. The result is a way of creating block templates that I personally love:

God I love Kotlin.
Here's what the now functional miners and tubes look like:

I also fixed a lot of bugs with resource nodes and began work on crafter blocks.
Offline ags1

JGO Kernel


Medals: 363
Projects: 7


Make code not war!


« Reply #5921 - Posted 2018-03-26 10:47:26 »

Been getting slowly back into Vangard. As a first step I am cleaning up the old code for the TreeML asset file markup language and adding a ton of test cases to it. I have a single test class that iterates through a bunch of test files which have tags showing what is expected from the test: whether parsing is expected to fail or succeed, what the expected node structure is post-parse, and then a bunch of xpath-like expressions that have to evaluate to true for the parsed document.

A typical test file looks like this (the structure string is a list of indentDepth:typeOfValue; groups):

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
#result::ok
#structure::1:1;1:2;1:1;2:1;2:1;3:1;3:1;2:0;1:1;
#eval::e1(2)='v12'
#eval::*[1](2)=e1(2)
#eval::*[:'v2'].f1.*[1]='vg1'
{
    e0 : v0
    e1 : v10, v11, v12, v13, v14
    e2 : v2 {
        f0 : vf0
        f1 : vf1 {
            g0 : vg0
            //comment
            g1 : vg1
        }
        f2 : null
    }
    e3 : v3
}


After I have got TreeML better than JSON I will flip to a new method to make the behaviors of Vangardians more deterministic and debuggable. Currently their heads are filled with a free-for-all cloud of competing behaviors, but now I will structure and classify the behaviors to help them pick the most sensible options. I will build a no-GUI sim of the new of the new logic then backport it into the game.

Offline princec

« JGO Spiffy Duke »


Medals: 1012
Projects: 3
Exp: 20 years


Eh? Who? What? ... Me?


« Reply #5922 - Posted 2018-03-26 10:53:09 »

You should have a go with my thjson library, ags1 Smiley

Cas Smiley

Offline ags1

JGO Kernel


Medals: 363
Projects: 7


Make code not war!


« Reply #5923 - Posted 2018-03-26 10:59:37 »

@princec I like your idea to include binary data values. Will copy that shamelessly. Smiley

Offline Guerra2442

JGO Coder


Medals: 48
Exp: 3 years


Guerra24


« Reply #5924 - Posted 2018-03-29 05:24:26 »

Rewrote the threading system from scratch with new 2-2 threads (main - background, render - background) and 2 extra when more control is need over the task. It became unstable as hell because some code doesn't like the thread where it runs now, the good side is that there is little to no input lag and assets can be loaded in the background.

Working on Light Engine.
Offline CoDi^R
« Reply #5925 - Posted 2018-03-29 09:02:03 »

Rewrote the threading system...

Yep, threading is fun. Found a race condition in our asset loader thread yesterday, which happened *occasionally* to the other coder on the project. I've never been able to reproduce on Windows or Mac OS. Tried to test and debug an unrelated feature on Ubuntu, and lo and behold, bug triggered every other run.

Robotality - steamworks4j - @code_disaster - codi^r @ #java-gaming
Offline ags1

JGO Kernel


Medals: 363
Projects: 7


Make code not war!


« Reply #5926 - Posted 2018-03-31 08:44:26 »

Put my cleaned up version of TreeML on GitHub, including schema language and validation.

https://github.com/agnes1/TreeML

Offline Guerra2442

JGO Coder


Medals: 48
Exp: 3 years


Guerra24


« Reply #5927 - Posted 2018-04-02 08:30:24 »

Started porting the engine to OpenGL ES, implemented a simple abstraction layer to use the same code regardless of the api and got the ui and resource loader fully working. Also changed the compositor rendering, instead of a double-buffer effect accumulator now uses per-effect buffer, this fixes issues with effect passes not working correctly.

        Old                           New
       
                           Old                                                                        New
         

Working on Light Engine.
Offline KaiHH

JGO Kernel


Medals: 515



« Reply #5928 - Posted 2018-04-02 17:47:03 »

Played a bit with implementing 2D shadow mapping in OpenGL using an approach I could not find elsewhere, which came to my mind before doing research on existing approaches, but after I read about the "analytical" solutions such as this one:
- create four 1D depth textures as array texture (width is something like 512 texels)
- render the depth of the four sides of an omnidirectional point light into these four depth textures with a single draw call by using layered rendering
- use standard depth comparison in the final shadow mapping shader, selecting the correct 1D depth texture to use based on the quadrant of the light direction
Result:
Offline dime26

JGO Ninja


Medals: 65
Projects: 7
Exp: 12 years


Should traffic wardens be armed?


« Reply #5929 - Posted 2018-04-03 00:37:19 »

Finished off a blog post I started weeks ago about simple weapon movement; a gun that looks at the mouse and flips right/left:

https://carelesslabs.wordpress.com/2018/04/03/nuclear-throne-style-weapon-movement-libgdx-gamedev/

Click to Play
Offline NuclearPixels

Senior Devvie


Medals: 24
Projects: 1



« Reply #5930 - Posted 2018-04-04 21:01:23 »

Not today, but lately was working on adding some "volume" to the game.. Going to focus now on fixing some glitches and might be releasing another alpha version before advancing with better graphics.


CERN-based beginner game devs. Follow us on Twitter: https://twitter.com/NuclearPixels
Offline FabulousFellini
« Reply #5931 - Posted 2018-04-08 23:52:02 »

I have been working on this game template still.  I don't want to put it in WIP just yet because it's just a template and not a game yet, but here's what I've done.  This update is for the particle emitter (which is supposed to look like fire), tile collisions with the player, the day / night cycle, and a half assed attempt at lighting (which is just a picture at the moment (sorry @orangepascal for using your light picture from a tutorial you made, but I wont use it as the final)).  And as always if anyone wants to look at my code and tell me what I'm doing wrong I would be happy for that Smiley   https://github.com/IanFell/GameTemplate

Here's the video:
<a href="http://www.youtube.com/v/NrU-sRw0xKI?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/NrU-sRw0xKI?version=3&amp;hl=en_US&amp;start=</a>

-FabulousFellini
www.fabulousfellini.com
Offline Guerra2442

JGO Coder


Medals: 48
Exp: 3 years


Guerra24


« Reply #5932 - Posted 2018-04-09 08:21:18 »

So... today I successfully ported my first game to Light Engine, took a while and some stuff is broken(physics) but it works. The Light Engine base code was from that game, although the api remain mostly the same since my last commit which made it a very straightforward process (mostly package renaming) but I had to made some changes to the engine to make it work with the old rendering system. I found out that having a somewhat large abstraction layer made it easier because the game specific code is not affected by changes to the engine, even with the changes to the threading system (in my other reply) it work without issues.

Working on Light Engine.
Offline ByerN
« Reply #5933 - Posted 2018-04-09 11:45:55 »

Today I've posted my first WIP Cheesy
http://www.java-gaming.org/topics/libgdx-akka-tanima-mmo-rogue-like/38654/view.html

Just after adding first boss to my game
<a href="http://www.youtube.com/v/SNdl7ngevng?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/SNdl7ngevng?version=3&amp;hl=en_US&amp;start=</a>

For now I have to refactor ai-tree tasks because are not modular enough which causes a lot of duplication. Next thing that I want to do is taking a look at some lighting system.
Offline ByerN
« Reply #5934 - Posted 2018-04-09 18:47:56 »

It was easy Cheesy
<a href="http://www.youtube.com/v/qiGblDDQXD4?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/qiGblDDQXD4?version=3&amp;hl=en_US&amp;start=</a>
Offline SkyAphid
« Reply #5935 - Posted 2018-04-09 23:19:23 »

Wow! That really looks great dude. Good job.

it just werks
Offline ByerN
« Reply #5936 - Posted 2018-04-09 23:25:47 »

Thank you! It means a lot for me Smiley
Offline kingroka123
« Reply #5937 - Posted 2018-04-12 03:28:34 »

Been really into machine learning lately. Cooked up a little library that works (mostly) but still needs a lot of work. Here are some of the results.

edit: also if anybody could suggest some other interesting projects I could do I would appreciate it because I'm kinda out of ideas

Classic classification problem. The network will separate the two blocks no matter their position.


A more complicated problem but the network handles it well I think.


Another complicated example. The network actually freaks out after a while on this one if left alone. Not quite sure why that happens.  Huh


And finally, a program that tells asks whether or not an image is of a "6" or a "g". An image that is a g has a value of -1 while an image of a 6 has a value of 1.



Offline SteveSmith
« Reply #5938 - Posted 2018-04-12 17:42:38 »

I started work on my magnum opus: a 100-player Battle Royal game.  Brace yourself for its awesomeness:-

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


Offline ByerN
« Reply #5939 - Posted 2018-04-12 17:45:08 »

Today I've added first NPC to my game along with talking with him. I am not alone in this world anymore Cheesy

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

Pages: 1 ... 196 197 [198] 199
  ignore  |  Print  
 
 

 
nelsongames (19 views)
2018-04-24 18:15:36

nelsongames (17 views)
2018-04-24 18:14:32

ivj94 (608 views)
2018-03-24 14:47:39

ivj94 (53 views)
2018-03-24 14:46:31

ivj94 (401 views)
2018-03-24 14:43:53

Solater (66 views)
2018-03-17 05:04:08

nelsongames (111 views)
2018-03-05 17:56:34

Gornova (176 views)
2018-03-02 22:15:33

buddyBro (747 views)
2018-02-28 16:59:18

buddyBro (94 views)
2018-02-28 16:45:17
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

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
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!