First image of what I’m working on. Going to an Oregon Trail type game.
Check this out http://ssw.jku.at/dcevm/ and updated fork: http://dcevm.github.io/
It can reload everything except changes to hierarchy and namespace, i use it together with some code that clears the asset cache and reloads all materials and postprocessing, and i rarely need to restart.
I like the homemade coffins
That looks great. Good luck with the development.
I can’t wait to play it.
Finally I found time to do something on my small project.
Actual it is not WIP 01/2019 but WIP 09/2018 but since then I fighted a lack of time and problems with updates.
Currently my project is more an advertisement (again) for the great lemur library.
My project will be (maybe if ever etc.) be a game and a separate editor.
I started with the editor and I will try to explain what you are seeing:
When starting the editor its loading a config file, thats holding the choosen language - and later some other basic settings. All menutexts and all game texts will be hold in an “config appstate” while the user is able to make its own language files (*.txt files) that are “detected” while loading the program. If an other language is choosen all ingame/and editor texts will be shown in that language.
The shown menu is one way to edit language files.
A list of all available languages is loaded to the left listbox. I have modified lemur listbox so you can select (and deselect!) more then one item. Here it needed some code to restrict it to max 2 languages and you are never able to deselect German.
The words of all selected languages are loaded to the middle listbox. My listbox is able to hold several columns while one up to all can be visible (if not all are visible you get an slider). I hope I can reuse that for e.g. overviews like player statistics or in any economic simulation when you need more then one column in a list.
Below you have 3 textfields - that I have modified as well. All 3 of them have full text select and copy paste functionality. Added Mouselisteners and a new lemur anchorsystem makes this possible. If the text is to long the fields can be scrolled while the line lenght is autoadjusted.
The element width is determined basing on the screen size (the left listbox is always between 15 % an 25 % of display size) and the other elements fill up the space up to 95 %. The small exit button is using the last 5 %.
The middle listbox has columns with different sizes (I needed to make changes to the lb layout here) that are also calculated basing on the size of the other elements.
If the textlenght is bigger then the column size the visible text is shorten automatically.
The screenshot also shows a moveable popup that can be called from all existing menus (only 3 at the moment) and is exiting the app.
If the size of your display (= the window where the app is played) changes all Gui elements are rescaled automatically.
All elements are in my own defined style, that is loaded with an separate LemurStyleAppState. So I hopefully just need to change the setting at one place and not for all GUI elements individually.
I have defined Buttons (e.g. the exit button, or an info button), labels, listbox,containers, some background pictures (not shown here), fonts,Button actions… and by doing so learned a bit about lemur and find a nice webpage for button icons.
During next months I try to make some progress with the editor (it depends on my work schedule a bit) and after that I may rework some of the style to make it look more great.
Anyhow - this small screenshot is maybe not looking too great but it definitely shows the big potential that lays in lemur as a GUI
Lemur is impressive, as always. Are you aware that Java provides built-in mechanisms (
ResourceBundle) for adapting software to local languages and customs?
Since we have laid dormant for so long again and there is talk of localization… This fits perfectly here! We have managed to finally get our hands on a Japanese copy of the game [Dungeon Keeper 2]. It took awhile since all the extra bit twisting that was happening compared to the other language versions… I hope it is correct, I mean I don’t understand it but it looks and sounds cool:
Honestly I was not aware of that. I had once made a search about how to make language packages.
My problem was, that I dont know what languages I or potential users may need + I am to lazy to later add everything by myself. So I need* a way to add languages or change wrong translations without changing classes or touching the code.
’ * at least thats what I believe at the moment.
If any user wants to add spanish, klingon, chinese or his own dialect it is theoretical possible without touching the project.
For @tonihele (gj with the japanese) this for sure makes more sense. Its a “closed” project and if ever it is deceided to add an additional language this is a good way to do.
I’m not familiar enough with Lemur. But I’d still say the resource bundles are the way to go. We are using them as well and at least Nifty supports them out of the box. As does the rest of the Java stuff. The only caveat with them is that UTF8 is only supported in recent Java versions. We are still at Java 8 and we needed to create (copy paste from the Internet) the support for that manually, just a minor inconvenience but worth mentioning if you decide to go on that route.
Oh man, the bitmaptext textures must be extensive for all that unicode.
Indeed sir. Our biggest font is 72 points/something, 7910x7910 2,44 MB PNG file. In comparison the English font file is 992x992 at 53 KB. Bullfrog was very creative and managed to get everything jammed into one CD. Extremely difficult it has been to get everything extracted. We are essentially converting everything to plain text or open formats.
Dayum, does that even work properly everywhere? Isn’t there some 4k x 4k texture size limit on some older gpus?
I’d rather go with 4 smaller ones for compatibility, but that would quadruple your text label draw calls I suppose. That is unless the bitmaptext class does texture stitching in which case it would be identical I guess.
I haven’t tested it extensively yet. The thought of using pages occurred to me once I saw the results. I’m not sure how that would affect the situation though…
I used to do the same, and probably would still choose to use a separate Main class for big changes/introductions of new features.
But for the little tweaks, I added a button which refreshes the game on the fly. First, my workflow consists of:
- Blender (used as lever editor/model designer)
- A text file which maps blender objects to j3os, blender materials to jme materials, copies textures, etc (updated version of AssetImporter on my github repo)
- A java file which reads the j3os, adds some scripts, ai, etc…
So adding a new part of a level/area consists of:
- Create scene, models in Blender → 2. Write asset import file → 3. run AssetImporter → 4. Write few lines of code to use the scene in game
Now to dynamically reload the game, all code I wish to be reloadable I put into a specific package. Then I use a custom class loader to load the class by reflection. Thus each time the button is pressed, first the entity system is cleared, asset manager cache is cleared and then the class code is reloaded at runtime.
Changing scenes in Blender is similar, after the change I save the file, run the AssetImporter and reload the game.
Here we see all of the debug states together. The bin status state (not really easy to see here) which shows which physics bins are in which state: loaded, active, etc… The body status state shows both the AaBBox and sphere bounds for the objects colored by their ‘temperature’ in the physics engine.
The blue arrows are the contact normals with the little red axes being the contact points. There is a ‘downward’ facing green arrow to show penetration but penetration isn’t deep enough to see in these contacts.
Also, the reason the ball in the top right is not aligned with its bounding sphere is because the visualization is ‘over the network’ while the debug state is raw to the physics space (it only works when you host locally). So it’s showing the time lag between what we see and what the physics engine knows. Also useful in its own way.
Working on GUI set up. Looking to make the text more readable by adding an outline. Is there a simple way to do this with a BitmapText or is the common practice to create a second black-colored BitmapText slightly larger behind it?
I added a black outline to my fonts by editing the .png file associated with the font. As far as I know, that’s the easiest way to add text effects like borders or shadows to a font.
You can also put a black version of the text right behind it and offset down and right… an easy (and relatively cheap) way to add a shadow. (That’s what Lemur does for shadows.)
BitmapText unfortunately doesn’t support outlines. The new version I was working on did. I got held up trying to support both versions in parallel and got side tracked.