Foojay Podcast #25: Game Development with Java, JavaFX, FXGL
JavaFXPodcast

Foojay Podcast #25: Game Development with Java, JavaFX, FXGL

Java and JavaFX are probably not the first options you consider if you want to create a game application.

But the FXGL library allows you to do precisely that! Create games that run on all platforms with the same codebase as we are used to with Java.

And even without an extra library, the JavaFX Components and Canvas provide many animation and gaming possibilities.

Let’s learn from experts why Java should be on your game-development-language-list!

Podcast Apps

You can listen and subscribe to the Foojay Podcast on:

Guests

Content

Transcript

Automatically generated from the audio, so it can contain errors in names and technical terms. Suggest a correction.

[0:00] Hello and welcome to this new edition of the Foojay podcast we’re going to talk about game development with Java podcast all your news about OpenJDK Java and Java vix are probably not the first options you consider if you want to create a game application but the FX gel Library allows you to do precisely that create games that run on all platforms with the same code base as we are used to with Java and even without an extra Library the Java vix components and canvas provide many animation and gaming possibilities let’s learn from some experts why Java should be on your game development language lists hi everyone I’m Almas I’m a principal lecturer in Computing at the University of Brighton I’m also one of the department heads for computing and Robotics these days most of my work is focused around developing AI for robots so one of the projects that I’ve started recently is around developing sort of brains for different types of robotic devices and then connecting all of them under one piece of software so you can think of it as swarm AI if you will and it allows robots to kind of communicate

[1:17] Collaborate on achieving a specific goal when not doing that I’ve got a bunch of Open Source projects on GitHub these are mostly around Java kotlin and jar FX and finally some of these are also recorded as practical tutorials on YouTube my name is Gerald humbard I’m working for Azure as a senior developer Advocate and I do Java for more than 20 years and I love it and when JavaFX came up in 2012 I think I mean the version that was based on Java not the JavaFX script thing I started using it and I still love it might not be the best thing for writing games but still it’s cool so yeah we will see I’m in chickens out and I’m currently a creator of information technology company which is called Wildwood City a typical name company name of a game company and then we have a game product which is extract which is already published on the Steam and also Google play but for the Google Play part we made a game using frame of the flutter flight game engine which is similar to fsglfx and we also participate in other jaw related seminars like vertex and we also organized some vertex user group in

[2:47] China here and also San juji in China is a very big company really big country so we have several user groups around this country and the game we made at the beginning is just a simple as a shooting map game but the name it can a little complicated because we go more powerful to like which is fsgr so we need to integrate many things many animals in there so for now it became a lot like games Okay thank you and I’m Frank the porter I’m a technical writer at Azul colleague of Garrett since one year now and I do love Java vix for quite some time I’ve not done a lot professionally with it but I’ve created a lot of pet projects and also have been playing with game development thanks to the fhgl library which is really great a little secret about the Foojay podcast we have now I think this is the 24th or 25th session the most popular one which has the most listeners is the one from December which were was also about Java vix where we talked about all the framework and libraries which are involved in the project so it’s nice that we can have a new session around Java vix and then especially about game

[4:00] Development almost I think the most popular or most well-known library for game development in Java vix world is fxgl that you have created can you tell us a bit more about it it’s effectively an extension of Jar FX and it was specifically designed to be that way it follows a lot of the principles and the architecture that jar FX follows initially which makes it almost a seamless integration and seamless kind of transition if you know Java effects then you know pretty much 75 of fxgl because effectively like variables are just normal properties and bindings therefore as easy and as you would do in them in jar FX and the initial idea was because your effects is not designed to be again development framework it’s a very generic purpose UI toolkit so effects GL just adds the game development layer on top of JavaFX therefore allowing people to build games a bit easier because everything is still done within JavaFX which means you could just use JavaFX to build games but fxgl just makes it a bit easier by adding various real-world game development techniques if you’re saying that if you know Java vix that you know

[5:23] 75 percent of every gel does that mean that 25 is the things you are missing in javafix I suppose so or rather the 25 are slightly different in terms of how you would use it so anything UI related is exactly as jar FX you just have extra UI nodes to play with and the other 25 I would well this is a very sort of arbitrary number I suppose and these are sort of things that add controller support for example so a bit of C plus plus in there as a bridge between Java effects and Hardware tools or Hardware code related to accessing controllers for example so that would be one of the things the other I suppose things like networking and saving materialization deserialization and stuff like that and like a collision detection that a rocket can hit something is that also something that is slightly modified because well jar FX already has Collision checks to some extent if you think about a node having a layout bounds object which can be used to check if they’re colliding or not it’s slightly extended in effects gel because we’ve got things like separated separating access theorem sat or objects

[6:53] That are say rotated at non-zero angles and a way to create a spatial almost like grid spatial system where we can separate objects that could not possibly Collide because they’re just too far from each other using grid index indexing so there are various techniques again on top of what JavaFX already provides to make it easier or more performant specifically for the use case of games which makes it a bit easier in the sense that the architecture allows us or the use case because I think is designed specifically for games and general effect is designed to work everywhere which is why it’s quite difficult to actually construct the architecture of java effects whereas fxgl’s architecture job if you will is a bit easier because it just focuses on games but you can actually do a lot more we have some Foojay posts yes yes you can we have articles about that where we created I think the first project we did together a dashboard with graphs showing that that’s our data so with most open source projects once you put them online they start a known life you have no clue I guess in how many projects it’s used but do you have a

[8:09] Rather you were to book so you can probably tell on the number of cells of your book How popular it is but do you have an ID how many projects use every year not really I mean in terms of GitHub uses currently it says that well it doesn’t even currently my page doesn’t show how many projects are actually utilizing this project but in terms of downloads it can get to I think 30 000 unique downloads per month I don’t know whether it’s bigger mods because I have nothing to compare again yeah yeah but I know one user and that’s Schengen you created your game with fhl can you tell us more about the game oh yeah well the game is at the beginning is just a shooting map of the game well at the beginning we create our game engine by ourselves but we don’t have too much experience with it and after several years later I just we just noticed the wonderful tour which is fsgl game engine which is created by professional people so we try to migrate our games after the several months we successfully migrate to this game to the fsgl and it greatly reduce and simplify that simplified our codes and make our

[9:32] Game development much more easier than before so I think this is a wonderful tool so we that’s why we celebrate ourselves we usually we share some experience on Twitter so we just write some code to see how difficult before before we use in fsgl and how easy after we use we’re using who created and the game is already made like or seven years I don’t remember but it’s yeah they’re progressing it’s already published on that thing but it’s still on the early stage if you say that you could simplify your code and improve your code by using fxgl so what were the hard parts that you had by creating a game in Java that now was solved by fxgl the most difficult part is 3D things 3D Parts but especially if you want to integrate a 3D part and the 2D part into the onto the same screen and then Things become a little bit messy and the good news is JFS provides such thing a component called subscene which could make this possible so we hope this will be will make things easier to do yeah I’ve seen I think project by you by orango mango who’s also doing a lot of game development with Java vix and sharing that on

[10:57] Twitter that indeed a combination of 2D and 3D can be quite challenging a little bit challenging and I expected we have made some prototype of this integration of 2D and 3D games and we can create HD 2D like effects Garrett you have been tweeting a lot recently about Retro Gaming so you found some kind of Fascination in retro games I’m not so young anymore so I mean I grew up and I have been the first versions of pong and this kind of things and then all these arcade games coming up and what came up and then it was for me always fascinating to see these these games and play it I’m a good friend of mine the parents they had a shop where you can rent card games so we went there every day and have been able to play without paying for it so but I never wrote a game so and then I helped out at the school of my son and saw one of the kids coding a game so and I thought maybe I should also do a game so and then I started really from scratch and created the space FX game just for the fun of it and I don’t want to use any libraries or something because I would like to experience like the reverse engineering right so how to

[12:25] Do this kind of things that was the main challenge and that was quite fascinating and I stopped after four levels but because then I knew everything that I wanted to do and always when I have some time and then I stumbled upon this arcanoid which I played a lot and then Tetris and load Runner and all these kind of things and it’s for me the fascinating part is to really like I said reverse engineer the games right so to figure out what is the what did they need to do to make it happen and it’s really interesting you stumbled upon some problems that you never thought about and then that it’s just fascinating to me and I was never a fan of 3D gaming so I’m old school 2D side scroller top scroller stuff like that or jump and run this is really something that I really like and like I said so I never tried fx3 to be honest and I probably will never do because I also never tried the swing gaming engines and all this because it’s for me the fascinating part like I said it’s figuring out how this works and that’s quite interesting so yeah that’s the main reason why I’m doing that I saw

[13:36] Some messages from you about the difference between using Java vix components and animating those or drawing in the canvas of java vix can you explain a bit what’s the difference there JavaFX is has the scene graph approach so this is really it’s nice when you create applications because because then you can create like these form-based things and you have all these interactions is all done easily in JavaFX and you don’t have to care about drawing and redrawing and all these things that we know from swing well it was not that easy and I remember the days when we didn’t have the canvas note so that was really tricky to do some special Parts in JavaFX because there was no ability to draw something like a noise for example it was not possible so then they came up with canvas and I knew canvas already from HTML5 and this is for me the best way to write at least 2D games right so because the nodes come they come with some overhead if I remember right it was 8 K per note that you get at least and if you do a lot of notes on the scene graph then it really gets slow so especially when you start using effects

[14:51] Like shadows and all these things so I figured out that if you do it the old-fashioned way so instead of rendering a shadow you just draw a transparent box or something like that which is much faster and in canvas it’s enough for gaming I don’t really I’m not a big fan of this realistic games that look like the original outside so I’m more a fan of if like the Nintendo games right so they don’t have the best graphics but there’s a lot of fun in the game and canvas is great for that because it’s really fast and for the at least it’s fast enough for me for the stuff that I’m doing so that’s the reason why I switched to Canvas completely I draw everything on my own and if you have for example Sprites then you can use Sprite maps and or image maps and use them like like it was in the past so it’s it’s an interesting approach almost is that a bit the same way that fxl is using well FX channel provides its own canvas as well which is effectively just our effects canvas but the core utilizes the scene graph approach for until you run out of performance effectively so if you run out of

[15:58] Performance you probably want to rethink your approach and potentially go back to Canvas but by default everything is represented as a game object which is known as entity and each game object has a view component attached to it and that view component is the thing that renders that entity to the screen we don’t really think the cameras is that component compared to larger FX components because we use camera create a game engine before but it seems like things like we will compare the canvas base okay managing to the fsglers gets better performance compared to the canvas I think Garrity wrote about that also that it’s about how you use the canvas you can also do it wrong well I think I use that quality well yeah it does depend on how the whole thing is being used I suppose because it’s just one node it’s for simple operations like drawing rectangles it should be very fast but when it comes to actual games on where you have lots of elements that are kind of interconnected intertwined I think it depends on the individual use case for example for a game for an RPG game called zephyria that had a massive

[17:16] Map that could not be drawn as a single node so instead it drew it into a writable image buffer so it had writable image as the node to go to into the scene graph but it was kind of like a viewport into the entire map if you will and that allowed us to get the necessary performance for that specific game by default fxgl will use the scene graph node approach and if you start Computing performance bottlenecks then it’s all down to just profiling and then figuring out what exactly is causing the bottleneck you shared some videos Almost with quite an impressive amount of fireworks for instance and big animations or these all top of a vixel these demonstrations that you provide yes all of them are done in fxgl and most of them are done without any optimizations to them so they’re just basically written as if they were written in a very quick way because that’s usually how you approach software development right you try something really quickly and then see if it works if it works and it is its performance is acceptable you just leave it there unless you have time to come back and refactor so in fact all of them are more

[18:36] Or less just the first draft implementations of various effects the possible system is reasonably efficient within the fxgl library but there was one use case where it was up to 10 million particles I think was that cannot be handled by fxgl natively I had to go down to GP GPU level and to be able to render so many particles but again that just demonstrates that jar FX Has the tools and all the utilities needed should you need that extra performance you see you quickly draft some examples like that I think that’s also the approach that Garrett is taking because everything you share as as these retro games is something that you have done while waiting for a plane or being on a plane that means that’s your favorite hobby well we well yeah I mean I do Drive effects now for I don’t know yeah since it’s on the market and only did that also do some Swift and HTML5 stuff but if you know how to use it it’s really easy to do and if I have time it’s it’s not the actual coding right so the problems you solve in your head some at some time and then you code it when you have the time which is probably at the airport or on

[19:59] The plane when I have time and wait for something then I can just continue working on that so yeah that’s that’s indeed my favorite thing to do when I have spare time I love to write those those games or other stuff so but I always like the visuals so and the Retro Gaming was really something that I enjoyed a lot I’m not a game programmer at all so I miss all the concepts I have no idea how it works I really try to make it work with the knowledge that I have so and yeah till now it worked for the stuff that I did what was the main challenge that you found while porting a retro game into Java the main challenge is figuring out the game idea for me because I usually I look up YouTube videos you always find a video about the original game like for example the akanui game so I found a guy who recorded the complete game from the first to the last level in one video so I just watched the video and tried to figure out what is going on and how are the animations done and all this and then I draw all the stuff on my own and created the animations on my own and did all of those things

[21:15] It’s figuring out how it works from just watching it that that’s that was the main challenge but this is if I reverse engineer an existing game for space FX was different because this game was just there was no game I just started and then I stumbled upon all these things like okay I need enemies then or how to do that then they have to fly somehow through the through your screen and then you figure out oh they have to follow some splines to make it more realistic then you figure out oh they only should shoot if you if they see you really if there is some kind of attack angle and then you come from one point to another and that’s really interesting if you see the game evolving over time it gets better and more fun and the only thing to make it better is to play it right so you play it and then you say ah no I’m missing something so how to do that then you look it up and you implement something try it ah it doesn’t work try again until it works and yeah so that’s how I did it and then that’s that’s a quite some fun to do that and I think all of us have been

[22:21] Experimenting also with the glue on tools to be able to convert a Java app to a mobile app to have it running on a mobile phone I’m wondering for force team how does that work changing you have to do some additional steps to be able to upload a Java game to steam well actually you don’t have to do such things if you upload a game to the steam because the steam client can help you to execute the science system commands such as like Java jar and Main class so compared to the mobile channels mobile distribution channels the steam channel is much more friendly compared to the use to the developers and you have the latest Java versions on there well we create a debugger system a debug page of the of our game so we showed which job version and which dual FX version and the fsgl version we are using and just for the debugging purpose yeah I got a question about the fsglo so fsgl is very powerful for the organization I really like the view component part but is it possible to extend the view component to provide the matching rule like animation supports like 3D animation support that’s a very good question for 2D I

[23:46] Think it’s reasonably straightforward to extend that because you’re effectively just adding notes to it and as for 3D I think it’s not the structural limitation there but more of a kind of 3D animation sequence and how to actually store that because currently fxgl can only load a DOT obj files such as plain text files that represent a 3D mesh after that’s been loaded we obviously need to apply some kind of 3D animation but how that animation is stored and what data we need to be reading in I think it’s going to influence how we might extend either view component or something else in order to actually run the animation and in fact it’s one of the sub projects currently available and that subproject will be completed by one of our students within the next academic year so from October there should be a student working on that sub project and we should be able to get it done by the end of hopefully the next academic year so it’s looking promising but in terms of how we’re going to implement we haven’t had a chat yet so we’ll figure it out at some point we’ve got a lot of students coming into

[25:00] Our user group so I just wonder how many Chinese students in the university in the Brighton University are have been creating fsgl I wouldn’t know necessarily because our student groups are quite large we have a large number of international students I wouldn’t know where they come from but we certainly have a large group of international students and we do use fxgl for developing various coursework or they use it to develop coursework for the subjects for their modules throughout their studies from the first year until the final year and that actually kind of relates to also use of java effects as well I try to introduce Java facts as much as possible within various software engineering modules so that students get this exposure to building Rich client applications with modern UI toolkit recently video I got a bunch of students coming to our user groups and they come from Hong Kong University and the university you know I think FS Chiller and the drivers become more and more popular because of the Java language itself is much more easier to use it yeah I suppose job as the programming language

[26:20] It’s more productive I want to say if you pick something like C plus plus as an example to compare against then I suspect given the same amount of time for both Java and C plus plus developer the general developer is likely to be slightly more productive because there are just certain things that are done easier and I suspect the whole build tool process will take a while on C plus plus using C plus plus to set up so from that angle there is a lot of appeal to learn Java as one of the first languages unless we certainly as a university teach Java is one of the primary languages and once you have a primary language then if you want to build something with it like a game then why not and the question is I suppose are there tools that help with game development so like jar FX that’s a library that you can use to build games as well without fxgl and people will obviously use these tools because you know Java is the primary primary programming language they want to build a game and they can certainly pick the tools they’re necessary so Almas you as in University lecturer so you’re using

[27:41] Java Java vix fxgl to learn your students to learn programming but on the other hand you also get your students involved to improve fhl which I think is a very nice approach it certainly is it’s a win-win situation because when students graduate one of the tasks is to build a or design develop and then complete a project and this is done over the period of well almost entire Academic Year and we get students from different backgrounds we’ve got computer scientists software Engineers game developers and you can treat fxgl as all three I suppose there are certainly computer science problems that need solving so I think graph Theory set theory pathfinding software engineering wise you need to be able to scale your applications and fxgl can work as an architectural project because there’s quite a few elements that you need to think about in terms of design a large scale application and from game development perspective social fxgl works as a game development platform so that allows us and the students to find a project they’re interested in and work on that project which has reasonably

[29:04] Real world implications and impact rather than just focusing on the purely theoretical projects which may not be as interesting it’s about the same approach that I use in the Swiss University f h and W we have an interview also on Foojay about that where they for instance calculate the shortest spot between two points that’s a typical software problem you need to solve and they created a game with a lot of lets and buttons and really a game approach where they combine electronics and programming and Raspberry Pi’s and Linux and so students get indeed involved with a lot of different Technologies to solve a specific problem and learn I’m very happy to see that Java is indeed used a lot in education for all these these topics why no fsgli is using kotlin to create some parts of the game engine people always ask questions like this whether quality is better than Java or Java is better than the coding so I always feel different to answer these questions so maybe fsgl can help you out the larger question of whether Copeland is better or not better than Java that’s a massive question I’m not I’m in no

[30:20] Position to answer that question personally I prefer kotlin because it has this conciseness about it loses some of the verbosity that Java has and kind of introduces things like nullable types so they’re actually treated separately as things that cannot be known for example and certainly the collections API where everything basically has has the same API whether it’s a sequence a collection or a list or an array or any other kind of data structure that can store elements all of these have the same API in kotlin that makes it just kind of the development more streamlined compared to Java but Java certainly has this feel to it that I cannot quite describe and it feels I know like cleaner to some extent but I wouldn’t be able to Define what clean means within this context and in terms of why kotlin is in effects jail partially because kotlin came out at some point during development and I was learning kotlin so what’s the best way to learn than to you know just use it so I ended up building a bunch of things in a vegetable that used kotlin and it just stayed there we have a bunch of developers who contribute various

[31:41] Things to fxgl some will use Java some will use kotlin it’s a hybrid project which makes both languages equally viable and easier to contribute if your primary language say is not Java as for functional difference I don’t think there is one apart from certain things that just easier to express in kotlin certain things are easier to express in Java I think that’s the best I can do in terms of answering this question I guess it’s a nice answer and I think it’s also a nice example of how Java and kotlin are just you can just mix them and they put work together perfectly Java and Java vix for mobile apps we already briefly touched it it’s not a very popular option but it does work and it is available what is your opinion about this using Java for mobile I know Garrett for instance you created some examples you’ve been on the experimentation path I started with that before glue on was even a thing so that was robovm in the beginning and I did directly when it came out I tried it and made some some of the JavaFX stuff work on my iPad and I did it I used it even a presentation at jfocus in

[33:00] Stockholm I don’t know when it was 2014 or 13. I like the idea that you can use your JavaFX application on a mobile device but I also use Swift I also did Android it’s it’s hard to compare that so Swift feels more natural on iOS you can do a lot of stuff using the glue on framework even on mobile but because you have to change the UI anyway when you go to mobile applications this is a fact because on the desktop you have horizontal orientation on a mobile you have vertical and you have endless scrolling and all these things and this is just different and you have to create the UI anyway that means you can only share the logic and for applications that I’m not sure if it really makes sense I was a big fan of it in the past but in the meantime I think it’s easier to get developers if you really would like to do a mobile app and use the native language of that device it’s kotlin for Android and Swift for iOS but still I like the idea when I create something in JavaFX that I could port to mobile and it’s so easy to do so I did that with all the games that I created so like Tetris

[34:28] And I can read and space effects I also created a native or on let’s say a mobile version that is a native app in the end they use gravyam to create the native image and it’s fast it’s great so it’s really good so I can’t really blame it that it’s slow in the beginning it wasn’t that fast but if you use it today there are even no big constraints anymore so you can really just build it and deploy it if you have a developer account on iOS this is a hurdle you need to developer account with apple to do that but on Android you can even do without and you can simply create the app by running another build project and that’s it and of course you need to keep in mind that where you use the mouse on the desktop you have to use your finger on the mobile device which is different and that leads to effects especially in games where you suddenly need to support touch and drag drop and these kind of things but you have the mouse pointer before and you need to make things visible like buttons where you don’t have a keyboard you can’t use the keyboard on a mobile device and these kind of things it’s you have to keep in

[35:38] Mind but if you can manage that and it’s it’s really easy and it’s a lot of fun but I’m not really a big fan to Port desktop applications to mobile because this is just different a desktop application is a desktop application the mobile app is a mobile app so which it depends so usually you create a specific mobile UI and then the question is does it make sense to do this work just to create a mobile application and also putting it on the App Store is possible it’s the hassle I mean this is just the truth you can do it I never was able to do that using an IOS app like a javaf except for iOS I had never managed to get it on the App Store and I do iOS development I have all the stuff that I need it never really worked because with all the signing of all the jars and libraries it’s just it sucks to be honest it’s not really a nice way to do that so and that’s the reason why I never put something on the app store for the Android version it’s probably easier yeah not agree really about the user experiments of the app store Google it has given me some nightmares I have to yeah it’s because you need all this

[36:54] Signing and this is not really part of the gluon pipeline right so because this is part of the iOS for example on Mac and it’s the iOS pipeline so you need to sign not only the job but all the classes all the libraries everything within the file to make it work and then there are additional steps you have to do just to be able to put it on the App Store and in the end it was for me too much trouble I didn’t have the time to do that so I decided to not do it I just give the coach to build it for mobile to the people and if they would like to do it then they just should build it on their own I have some done some experiments and I have GitHub actions who are doing the build and who should be able to publish it but that’s also what I can predict yeah yeah I know what you mean good it was always bad from the beginning it’s I mean this is not really gluons fault this is just the problem with putting something on the App Store yeah the store is complicated so it’s not easy so that’s why I was happy to hear that steam actually is easier and that it’s easier yeah and the changing indeed has his

[38:07] Game on which is a Java game is on Steam available well I think that the difference between the Steam and Google play is you don’t have to create a native image first things you can use use it like a regular Java application you don’t have to make a native application but if you want to publish on the App Store you have to make a native Native images and about interaction with mobile games I know in fxgl you have some virtual joysticks and stuff like that you can add to your game where you are missing a keyboard so there are indeed a lot of possibilities and like you were mentioning you have glue on who can interact who has library to interact with audio and till sensors and stuff like that so yeah there are a lot of tools but yeah I don’t think we have that much Java Games living in Mobile worlds we also touched briefly about 3D Sean Phillips who has created a very impressive 3D application to visualize data it was also using Java vix he was telling in an interview we have on Foojay that actually 3D in JavaFX is good but not perfect you have some experience with 3D well we try to make

[39:21] Some proof of Concepts in a 3D area but the first reaction is we think of fsglr so we just keep asking whether fsgl can do this with fsgl can do that anything that is reasonably primitive so like cuboids spheres and cylinders and stuff like that measures for them are quite easy to Define and utilize the texture mapping onto these meshes is also reasonably straightforward once you figure out the coordinates the lighting is not sure how hard to describe it I’ve never been able to perfect the lighting in my scene graph it’s just interesting I’m not sure if it’s something that I’m doing wrong or something that’s not quite right in terms of how it should be lit but I’m slowly learning all the 3D aspects as well of java facts and the things I can provide just neatly because I know there are some limitations related to some like shaders for example which whilst I think technologically possible are not the most straightforward to implement from native jar FX materials might be another thing I think there’s only one type of material available by default which may also

[40:57] Be extended in future versions of JavaFX 3D but if it’s a reasonably simple scene graph and you need to animate a few things in there that should not be a problem well actually I think the fxyz library is worth mentioning because a lot of fxgl’s 3D code is based on fxyz and tries to kind of integrate that into the game world that fxgl knows about and defines it as such so if you needed to do anything related to 3D I think the best place to start would be fxyz actually because it will have a bit more stuff to play with it’s the same one that Sean Phillips is using for his his application and that’s the one he wrote with Jose so they’ve wrote it couple of years back and I heard some historically fact that actually Java vix 3D was on a pod to become really powerful but yeah because of some choices somewhere in the development it was actually postponed and probably still waiting to be further improved and then luckily you have these libraries that come in I think I saw the video on the YouTube is things and they create a chess game right with a 3D 3D animation of larger effects so it’s less is it open source

[42:26] Where we can find a source code of land chess game this is available so I know that because I worked at Oracle at that time so we made it available it should be somewhere that was a nice demo but there was an even better one where they used JavaFX 3D to visualize a port with all the containers and the Container Terminal that was a really impressive demo where they did they had a camera flying around the whole area and in real time they can move these carriers that carry the containers on the yard and all that was really impressive but unfortunately that was only a demo so it was never really yeah so this source code is not really available and I think it was just a proof of concept but it showed in a quite impressive way what is possible if you know how to do it unfortunately that never really made it further into the development pipeline so for this demo stay they tweaked and hacked a lot so to keep it short so it’s really it looks great and that was the main purpose it has to be a great demo yeah so that means it’s not really the standard so but I totally agree to almost so yeah

[43:42] The basic stuff works but it’s missing the more advanced 3D things and probably they never made it into development they had some some nice plans but yeah when people left and Oracle decided not really to continue working on that and that’s the whole thing we have an article on Foojay about 3D and javafix some historical indeed looking back at what happened and I think with some links to that chess game I will look it up and add it to the show notes what we didn’t mention yet is a Swing Swing is another UI tool within Java as far as I know I didn’t use it a lot it’s a long time ago is it still evolving is it comparable how should we look at it swing versus javafix oh it’s I did a lot of swing before job effects came out and swing is a totally different approach it’s direct drawing so that means it’s like the canvas all the time it has some kind of components that have substructures like the buttons and all these things but in principle you have some kind of a canvas where you draw on and it’s up to you to clean it to redraw the dirty areas and all these things the drawback is that when creating apps

[45:00] It’s a hassle to do that because you have to keep track of all these dirty areas and repaint them correctly if you know how to do it it’s really fast and I bet it can be at least as fast as Drive effects I like it could be faster I can imagine because they had ports to opengl this jogger thing the problem with swing is that the API is quite old and you can feed it everywhere so it’s not really that convenient you don’t have these properties that we know and it’s just old right it’s in there since I think Java 1.2 and that I think was the version where swing was added and you can fill it in the API everywhere but if you know swing and then you saw Drive FX you see that it was done by the same people so they took over a lot of the same Concepts but in then they added the scene graph functionality to JavaFX which is not in swing and there is no really active development anymore they do some add-ons I think they added support for high-risk monitors and all these but as far as I know there’s nothing really going on in swing because it has a lot of libraries also there’s a huge at that

[46:19] Time and that’s some of the problems that JavaFX has these days in the swing days there have been companies that created libraries and they sold them for a lot of money and they have been good libraries and this is not not really the case these days anymore for job effects which is probably a reason that JavaScript everything is available for free so why should I pay for something in the job FX world but spring in general I would say is still it’s a great framework it’s used a lot really a lot in big companies in the military it’s used a lot I know that insurance companies and Banks they use that for internal programs so it’s good it’s not bad but big difference with javafix which has a six-month release cycle just like Java and a big Community still developing in it so yeah that’s probably also one of the big differences then changing as you said in your introduction you’re a member of the Chinese vertex user group so as we have you as a guest so let’s look a bit to China it’s an unknown area for me so how big is the Java Community there the Java vix Community are there a lot of developers

[47:28] Working with these yeah we do have a lot of jujs in this country because China is a very big country yes one-fifth of the world population living in this country so we have a lot of jugs in here the problem of this country is the earlier is too big so we cannot see each other very frequently we usually we organize a seminar virtually of in the internet so for the vertex we all like it because this is a very small tools not very big by the other Frameworks for the vertex they only only has two dependencies one is the Jackson for the Json passing and then the other one is Neti so the so this small tools okay help us over the progress on the server side and for the client side we use the jaw FX and later for now we use the fsgl so we keep the dependencies as as little as possible so we don’t need to depends on too many libraries in there we have some kind of like people with the same interest in these small tools well text user groups is much more active compared to the other two ugs I don’t know why and when we start advertising the jfx on these groups and people are interested in so we have a more and more people

[48:57] Joining in our groups so but we also have some JuJu’s in the big cities like Beijing Shanghai and Hong Kong maybe but I still don’t join those juts because they people are using joy in different areas you know so many experience we can share with each other we just focus on the vertex and jar FX okay I think I went through all my questions that I had prepared is there something else you want to be discussed or announced or whatever I do have questions so we are thinking of creating a visualize visualize animation Creator something maybe we can call it the entity Builder about it drag and draw opponents around entity is it visible for the fsgo maybe we can create a Starbucks project for that could certainly work within the co well that’s kind of partially the idea of the editor for effects gel so that could definitely work in terms of design and development for the entity Builder whereas the editor is suppose well it’s supposed to be like any other editor in a game engine like Unity or Unreal Engine where you have a set of tools where you can just create a game world and then export it so far you

[50:22] Can create an entity you can attach a view component with an image to it and that’s about it doesn’t really export it to anything so you can’t utilize the output you can run it but you can’t then save it serialize it but it’s certainly possible so if there is any interest in that kind of line of work I’m sure I can provide some basic stuff to work with that would be actually quite interested myself to join the development as well maybe this these are still potentially I don’t know when it’s going to be a student project because I can’t think of any projects that are currently going down that rate but in the future in the near future yeah certainly well about fxml Macabre language people are complaining about this is it a good idea we can use in FSM or we just use the pure jar code to write a UI I can tell you something about that I’m not a big fan of fxml but I worked in a project where the customer decided to do everything in fxml and they use the what is the name of it this tool they created from Groupon Builder the scene Builder yes so they used the symbol and they did it in the

[51:45] Right way so they really created small entities like button panels and all these things and then they just composed everything in the scene Builder and that worked quite well so that was really well done and if you do it like that then yes I agree I like it what I don’t really like is that you have the description in an XML file and this is separated from the code and then in addition you have a CSS that all reminds me on HTML and are also not a big fan of that you have the separation of you do something in fxml then you have to have a controller and then you also have a CSS file and in all these things you can do different kinds of oh you have an action here or it changes the CSS and that changes the style and you have animations in code so it’s for me it’s not really straightforward so I that’s the reason why I always prefer to have it just in code I also was a big fan of the CSS stuff in the beginning and then afterwards when I figured out I can’t do anything in CSS that I can do in code I switched back to completely code fxml can be nice if you use it in the right way it can be cool but it’s not easy to

[53:01] Really do it in the right way because you have to break down the whole UI into this small parts and then you can really use and reuse them and style them separately which is nice but on the other hand it to me it looks like it’s a huge overhead you create all these files fxml files to describe something that encodes just a few lines of code but here you have to trying to fxml create the CSS for that fxml create a controller for the fxml and then encode you combine everything it depends on the project I mean I’m not a big fan of it but it doesn’t mean that it’s not good so I saw it can work quite well but for me it’s not really something I would use but that depends on each person and also on the project I’ll just how you set it up and if you’re structured in the right way then it can work also quite good but that’s my personal opinion right the typical answer it depends yeah yeah so then the other question is when the same Builder will provide a code upon approach now is it possible for the scene Builder to provide another approach they just create a pure draw code without an XML not that I know of

[54:17] So this is really made to create fxml and use fxml so you can add libraries with components and then you can drag them it’s a UI editor that is based on XML files right this is what it was made for so it was not to create code like it was in the old times where you have in netbeans there was an editor for swing that created code for you but then at that time you can’t really change the code because when you change the code the editor couldn’t read it anymore so that’s the drawback if you create code then you need also a parser that is able to pass this created code and to do that it has to be in a specific format so you can’t really create code and then change it afterwards and then that the whole UI Builder thing is not easy to solve and I think using fxml it’s it’s great for this kind of use case UI Builder is really great but if you would like to create code I think this is really a big challenge so I’m probably the symbol I won’t be able to do that may be perfect topic for another podcast about javafix where we discuss the tools and so yeah thank you gave me a subject

[55:31] To put on the agenda for the next season I think we have to conclude thanks a lot all for your experience for your feedback and how you use Java and Java vix to create games so I invite everyone to visit the links together with the podcast and start gaming or Retro Gaming or on steam or create your own game with FX shell have fun with it thank you very much my guests and you The Listener for listening to this podcast keep an eye on Foojay for future articles about development and everything related to the Java worlds of OpenJDK

Found a mistake, or something to add? Edit this page on GitHub

Written by

Almas Baimagambetov

Principal Lecturer, Computing Department Lead at the University of Brighton. Author of #FXGL game engine. #Java #JavaFX #Kotlin open sourcerer. PhD in Computer Science.

Written by

Chengen Zhao

Chengen is the founder and currently the tech lead of Company White Wood City which is a software company mainly focus on Java, Flutter & Swift related technologies.

Written by

Frank Delporte

Frank Delporte is a Java Champion, Java Developer, Senior Technical Writer at Azul, Blogger, Author of "Java Programming for Raspberry Pi - A Hands-On Guide to Electronics and IoT Projects", and Open-Source Contributor for Pi4J, Lottie4J, Sheetmusic4J, …

Written by

Gerrit Grunwald

JUG Leader, Java Champion, Speaker, Author, ❤️ Java(FX) and coding in general

Related posts

Join the discussion