tag:blogger.com,1999:blog-6310941109536688132024-02-20T19:22:16.318+01:00AntonioR DevLogHobby 2D game developmentAntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.comBlogger61125tag:blogger.com,1999:blog-631094110953668813.post-32997659481292350122021-09-10T10:18:00.000+02:002021-09-10T10:18:24.337+02:00Captain Quake - unfinished game prototype<p style="text-align: center;"> <iframe allowfullscreen="" class="BLOG_video_class" height="352" src="https://www.youtube.com/embed/Xgr8R7aC5Rw" width="482" youtube-src-id="Xgr8R7aC5Rw"></iframe></p><p><span class="style-scope yt-formatted-string" dir="auto"></span></p><p><span class="style-scope yt-formatted-string" dir="auto">After playing the game "Claw" from 1997 this was supposed to be a short 2 week project to test how fast I can prototype a simple game using my Broken Mug Engine and to again spark my interest in this hobby. That was June 2019. More than two years later I am releasing this in an unfinished state and I can say that original idea failed miserably.</span></p><p><span class="style-scope yt-formatted-string" dir="auto">As you can see it is a mix between Claw and Quake 2 with a dash of Metal Slug on top. I have cut two thirds of the first level and haven't put the final polish on many features, but at least it is in playable state. I have planned to write a detailed editor manual and also make few map examples, so someone might try making their own levels, but that was also left unfinished. I wish I could have released it all in a better state, but I really had to force myself to work on it and I don't want to delay anymore.</span></p><p><span class="style-scope yt-formatted-string" dir="auto">Anyway, this is still technically the most advanced project I made, even compared to the 2012 Quake 2D demo. You can see Box2D physics in action, colored lights, complex particle effects made using an actual particle editor, interpolated skeletal animation made using an animation editor, boss running around using waypoints, event listeners controlling platforms and sounds, and all the objects, weapons and enemies are defined in external XML files, everything is highly customizable.</span></p><p style="text-align: center;"><span class="style-scope yt-formatted-string" dir="auto"><span style="font-size: x-large;"><a href="https://drive.google.com/file/d/126UOPpzdhwhZu6F8ecoYTGwU-3YV56zw/view?usp=sharing" target="_blank">Download (Google Drive)</a> </span></span></p><p style="text-align: center;"><span class="style-scope yt-formatted-string" dir="auto"><span style="font-size: x-large;"><a href="https://www.moddb.com/engines/broken-mug-engine/downloads/captain-quake-unfinished-game-prototype" target="_blank">Download (ModDB)</a></span><br /></span></p>AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com2tag:blogger.com,1999:blog-631094110953668813.post-52518870019361033812021-08-07T17:39:00.006+02:002021-09-16T22:19:15.027+02:00Baking a GPU in the oven - Part 3<p>More than 2 years after I baked my Sapphire R9 270X for the first time the thing still works. In total I baked it 7 times since June 2019:<br /><br />1. June 2019 - 190°C/8 minutes - worked the longest period of 8 months<br />2. February 2020 - 200°C/10 minutes - worked only month and a half<br />3. May 2020 - 200°C/15 minutes - worked 6 months<br />4. November 2020 - 210°C/12 minutes, worked just few days<br />5. November 2020 - 220°C/15 minutes, worked 6 months, but it crashed several times, but it would work after reboot<br />6. April 2021 - 210°C/15 minutes, worked 3 months<br />7. July 2021 - 200°C/15 minutes, worked just a month<br />8. August 2021 - 210°C/15 minutes, to be continued...<br /></p><div class="separator" style="clear: both; text-align: center;"><a href="https://i.imgur.com/n0ZtxVM.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="658" data-original-width="800" height="526" src="https://i.imgur.com/n0ZtxVM.jpg" width="640" /></a></div><p>As you can see the poor thing doesn't even have its original fans. One fan became noisy so I removed it and put one of my case fans which I connected directly to PSU with a molex at 12V. In worst case so far it reached 78°C, but that is still under control, since it only happens in summer when my room is warmer.</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://i.imgur.com/JYd2zGK.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="518" data-original-width="800" height="206" src="https://i.imgur.com/JYd2zGK.jpg" width="320" /></a></div>In this picture you can see how the plastic on the board changed its color because of all the baking.<br />AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-81747817118003346802021-07-08T14:06:00.008+02:002021-07-29T22:45:28.497+02:00Broken Mug Engine - destructible 2D terrain and objects<p>After almost 5 years finally a new Broken Mug Engine video and playable demo. I was trying to
make the code from my 2014 destructible terrain demo work again and I
got carried away. It is still based on Box2D, Clipper and Poly2Tri
libraries, but is much more advanced. No mugs were actually broken during writing
the code and recording this video. <br /></p><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="349" src="https://www.youtube.com/embed/ZugWhTfs7vE" width="620" youtube-src-id="ZugWhTfs7vE"></iframe></div><br /><p></p><p>Here are some of the new features:</p><p>- support for multiple destructibles</p><p>- FBO or polygon based destructibles</p><p></p><p>- dynamic destructibles with rotation, scaling and proper UV mapping</p><p>- splitting of destructibles into new destructibles<br /></p><p>- debris - fake voronoi triangulation, particle effects, decals</p><p>- support for holes and enclosed environments</p><p>- preservation and destruction of joints</p><p style="text-align: center;">You can download the demo from my Google drive or Mod DB:</p><p style="text-align: center;"><span style="font-size: x-large;"><b><a href="https://drive.google.com/file/d/1oon-BxcCSOXjJ9E7wUKqTS35DcbSScUO/view?usp=sharing" target="_blank">DOWNLOAD</a></b></span></p><p style="text-align: center;"><span style="font-size: x-large;"><b><a href="https://www.moddb.com/engines/broken-mug-engine/downloads/tech-demo-destructible-2d-terrain-and-objects">Mod DB</a> </b></span><br /></p>AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com2tag:blogger.com,1999:blog-631094110953668813.post-56799329211998145712020-09-22T11:12:00.003+02:002020-09-22T11:20:14.237+02:00Serious Sam 2D TLGH - full playthrough on Serious difficulty<p><span class="style-scope yt-formatted-string" dir="auto">I released this game 10 years ago and since nobody made a full playthrough video I did it myself for the anniversary. I did not play this for a long time, so I am a bit rusty. In some parts you can see me shooting a biomech with a shotgun. I was trying to save rockets for the werebull part, but then I picked up a rocket ammo pack like an idiot when I was almost full, which caused trouble later when I ran out of them. You really need to be careful with ammo in some parts. Game was designed to be hard and I really had trouble in few levels. It took me an hour to finish and half an hour was just to beat the final boss. The final boss can only be reached by playing on Serious difficulty. If anyone wants a challenge try to beat the game on Serious with no deaths.</span></p><p><span class="style-scope yt-formatted-string" dir="auto"> </span></p><p><span class="style-scope yt-formatted-string" dir="auto"></span></p><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="360" src="https://www.youtube.com/embed/mlP26GyFgks" width="479" youtube-src-id="mlP26GyFgks"></iframe></div><p></p><p><span class="style-scope yt-formatted-string" dir="auto"><br />Game must run at 64 of 67 FPS. By design it should be 64, but 67 is also fine. If it runs lower than that it will impact the minigun fire speed and Level 3 (the one at night) will be impossible to finish, because there are too many enemies and they come in too fast. Windows timers are for some reason all messed up and sometimes game runs at 50 FPS, but then you can try running some other program in the background to "magically fix" the timers to get 64 or 67 FPS. When I was still using Windows XP I could use WinAmp for it, but now on Windows 7 having Tixati running in background helped.</span></p><p><span class="style-scope yt-formatted-string" dir="auto">It was originally supposed to be similar to Seal Hunter, but it ended being what it is. The final boss "Beshtiya" (basically means "beast") was inspired by the first boss in Metal Slug 2 that burned the player with its engine exhaust and soldiers would fire from the top. The fireball attack in the "head form" was inspired by the final boss in Metal Slug 1 when he drops bombs from the helicopter over the whole screen. One guy once said the birds in this game are out of place and they really are, they really look bad. Them triggering stuff was inspired by the birds in Turok 2 where you would open a secret area by shooting them. Also one thing I would like to mention is the behavior of the werebulls. In original games they would turn around if they miss the player, but here when they reach the left side of the screen they are teleported to the right at the same Y position as the player.</span></p><p><span class="style-scope yt-formatted-string" dir="auto">Game is set in 2018 and in the end it says "To Be Concluded", but that will not happen. You can see G-Man in one level and Beshtiya drops a crowbar. Well, the story was somewhat inspired by the movie "Last Action Hero". Trying to stop Serious Sam once and for all, Mental developed technology that could transport him and his armies from the video game to the real world, so he could destroy Croteam, creators of Serious Sam. He invaded real Earth and destroyed all game developers and their games, but he could not locate this obscure country called "Croatia" on the map, so Serious Sam was the last video game hero left to defeat him.</span></p>AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-73869612126799917952020-07-08T18:41:00.000+02:002020-07-08T18:58:57.807+02:00Intel stock CPU cooler vs. Cooler Master Hyper 212 EVO<br />
Two or three years ago I bought Cooler Master Hyper 212 EVO cooler for my i5-4690k processor, but I never took the time to actually install it until now. I was using the stock Intel cooler, the thin aluminium one with a copper core, ever since I bought the new computer in late 2014.<br />
<br />
I used the included thermal paste when I installed the new cooler. I used my AC to bring the room temperature down to 24°C when testing and removed the case side panel. I used CPU-Z stress test to keep the processor at 100% load and HWMonitor to keep track of the temperatures.<br />
<br />
With Intel stock cooler the idle temperatures were around 30-32°C. After 10 minutes of stress test the maximum reported temperatures were 74-80°C depending on the core. The maximum fan RPM was 1860.<br />
<br />
With Hyper 212 EVO cooler the idle temperatures were around 24-26°C. After 10 minutes of stress test the maximum reported
temperatures were 45-51°C depending on the core. The maximum fan RPM was 1300. So, with default settings in idle the difference is around 5°C and during stress test it is around 30°C which I did not expect. <br />
<br />
Then I repeated the test with fans set to "silent mode" in BIOS, where
they only spin at 750 RPM, and even then the maximum temperature goes
only to 55°C.<br />
<br />
Then I tried overclocking the CPU to 4.4 GHz (stock is 3.5-3.9 GHz) with fan running at only 950 RPM and the temperatures went only up to 71°C, so I might even go for 4.5 GHz with higher RPM.<br />
<br />
I was really surprised with the difference on default settings compared to the stock cooler and how well the new cooler can handle even overclocking.AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-68292881516412388812020-05-30T12:00:00.001+02:002020-05-30T12:11:57.371+02:00Lenovo G580 - first time cleaning after 7 years<br />
My mother's Lenovo G580 laptop from 2013 started to sound like it will take off even when just watching videos online. Using Hardware Monitor program I could see it is hotter than it should be. I never tried disassembling a laptop before, but it was getting on my nerves, so I decided to do it. Luckily there are several videos available on YouTube showing the whole procedure.<br />
<br />
I bought thermal paste (Arctic MX-2) and I also bought a 120 GB Western Digital Green SSD in hope it will speed up the laptop a little bit and I could use the 500 GB hard disk from the laptop for myself, since she doesn't really need any storage at all.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/r76rO3X.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="600" data-original-width="800" height="480" src="https://i.imgur.com/r76rO3X.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/aq3mMfT.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="600" data-original-width="800" height="300" src="https://i.imgur.com/aq3mMfT.jpg" width="400" /></a></div>
<br />
It is ridiculous I had to disassemble everything to get to the fan, it should have been designed better. As you can see the fan exhaust was completely blocked by dust. There was only a little 1 mm hole on the left where air could get out. I cleaned everything, applied new thermal paste and put in the SSD.<br />
<br />
When watching YouTube or a 1080p movie in VLC the CPU temperature was around 65°C before, now it dropped to around 50°C. Room temperature was around 22°C. The maximum CPU temperature I got while testing was now 20°C lower, from 78°C to 58°C. It is also important to mention that these lower temperatures are achieved with the fan spinning at much lower speed which makes the laptop more silent. I was very happy with the results.<br />
<br />
Replacing the old hard disk with a new SSD did not make much of an improvement since the laptop is mostly used for web browsing, so the speed of the SSD is not really noticeable. The biggest bottleneck there are basically ads or ad blocking plugins slowing everything down. At least it is completely quiet and I got myself a 500 GB hard disk I can use to store my stuff.<br />
<br />
After everything was done I realized I could have also replaced the 2 core/2 thread Intel Pentium 2020m CPU with a better 2 core/4 thread i5 CPU which can be found for cheap now. It is not really necessary since the laptop still performs perfectly fine. The only use case where it fails are x265 encoded 1080p movies, where it can reach 100% processor utilization which causes stutters, but x264 encoded movies run without issues. Maybe in a few years when it is time to clean it again...AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-92088955860021900592020-05-05T10:57:00.003+02:002020-05-05T11:03:32.834+02:00Baking a GPU in the oven - Part 2<br />
Last September I wrote about how in May 2019 I had issues with my old Sapphire R9 270X GPU from 2013 and how I fixed it by baking it in the oven and how it was working with no issues for months.<br />
<br />
<div style="text-align: center;">
<span style="font-size: large;"><b><a href="https://antonior-software.blogspot.com/2019/09/fixing-gpu-by-baking-it-in-oven-it.html" target="_blank">Link to Part 1</a></b></span></div>
<br />
Now I have to report that the GPU worked for 8 and half months in total, until February 2020, when it would again give only black screen when in Windows. I played and finished 8 games during that period with no issues, so it did serve its purpose well after being baked.<br />
<br />
After making a short break from more demanding games and using my integrated Intel GPU for about a month, I baked the R9 270X again in March, this time for 10 minutes at 200°C. To my surprise it worked again. Unfortunately I managed to play and finish only 2 more games this time before I got a black screen once again, two days ago. So, this time it only worked for one and a half month.<br />
<br />
I baked it again! At 200°C, but I left it inside for 15 minutes this time. After playing around with the oven thermostat a bit, I'm not sure how well the oven and the thermostat even work and if the temperatures are accurate. Nevertheless, it fixed my GPU again! Now, let's see how long will it last this time...AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-39651739373877686442020-02-16T22:33:00.000+01:002020-02-18T10:53:25.901+01:00Dungeon Siege - high resolution textures (ESRGAN) - Part 2<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/942VXlq.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="450" data-original-width="800" height="360" src="https://i.imgur.com/942VXlq.jpg" width="640" /></a></div>
<br />
<br />
<span class="style-scope yt-formatted-string" dir="auto">After more than 4 months of work I have uploaded the texture pack for Dungeon Siege that contains 3929 updated textures and is 5.97 GB large (compared to original 700 MB). All terrain textures have been updated, 750 world objects and decals, as well as bosses and some larger enemies and NPCs.</span><br />
<br />
<span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto">No custom textures have been used, everything is based on original textures. I think the new textures preserved
the original look very faithfully. You can watch the comparison video on YouTube and download the texture pack on ModDB:</span></span><br />
<br />
<div style="text-align: center;">
<span style="font-size: x-large;"><b><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><a href="https://www.youtube.com/watch?v=V8WMZhyBg7k" target="_blank">COMPARISON VIDEO</a></span></span></b></span></div>
<div style="text-align: center;">
<span style="font-size: x-large;"><br /></span></div>
<div style="text-align: center;">
<span style="font-size: x-large;"><b><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><a href="https://www.moddb.com/games/dungeon-siege/addons/dungeon-siege-high-resolution-textures" target="_blank">DOWNLOAD</a> </span></span></b></span></div>
<br />
This is the first time I hit limitations of 32 bit programs. First when I
went to pack the textures into dsres files (think of it like Dungeon Siege rar archives), the program would stop when
hitting 4 GB. Then the game would not load dsres files larger than 2
GB. Luckily the game was designed to load multiple dsres files.
It is surprising all this even works, considering the increase in size. One fun fact; game originally supported screen resolutions only up to 1024x768, but now many texture files themselves are larger than that at 1024x1024.<br />
<br />
<span class="style-scope yt-formatted-string" dir="auto">Probably more than 99.9% of textures were updated using the "Misc" model. "Misc" is a fantastic universal model, the author "Alsa" did an amazing job. </span><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto">Other models used were "Manga109Attempt", "Skyrim Wood" and "Ground". </span></span><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto">Manga109Attempt was used for things that are supposed to look cartoony, like paintings or carpets with colorful designs. </span></span></span></span><br />
<br />
<span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto">A lot of work
went into fixing and tweaking the original textures in GIMP to prepare
them for ESRGAN for optimal results. Original textures were often blurry, some were too pixelated, others had compression artifacts that would be further exaggerated when upscaling. Simple use of noise and denoise filters on original textures produced great results. Also some sharpening of original textures before sending it to processing can help a lot.</span></span></span></span></span></span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/vMUayBj.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="800" height="640" src="https://i.imgur.com/vMUayBj.png" width="640" /></a></div>
<div style="text-align: center;">
<span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"> <i>Blurring pixelated parts and adding noise to original texture before upscaling improved poor original result.</i></span></span></span></span></span></span></div>
<br />
<span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto">Skyrim
Wood model was useful in few occasions where the original texture was
extremely grainy, this model gives a "grainy blur" result which worked
well on few tapestry, some carpets and statues.</span></span></span></span></span></span></span></span></span></span><br />
<span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"> </span></span></span></span> </span></span></span></span></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/S0N4Sfb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="512" data-original-width="512" height="640" src="https://i.imgur.com/S0N4Sfb.png" width="640" /></a></div>
<div style="text-align: center;">
<span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"> <i>Skyrim Wood model.</i></span></span></span></span></span></span><br />
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto">Sometimes models give good results for one part of texture, but fail in other parts. For the terrain around Fortress Kroth I had to cut the grass from the "Ground" model results and copy it over grass from the "Misc" model.</span></span></span></span></span></span><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/G1MlTYj.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="800" data-original-width="759" height="640" src="https://i.imgur.com/G1MlTYj.jpg" width="606" /></a></div>
</div>
<div style="text-align: left;">
<span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><i> </i></span></span></span></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: left;">
<span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><span class="style-scope yt-formatted-string" dir="auto"><i> </i></span></span></span></span></span></span></div>
</div>
<br />
Adding a bit of HSV noise in GIMP to original texture can add a bit of detail in the final texture. In this example this helped making snow look less like shaving cream and more like snow. It is a very subtle difference. Adding too much noise would make it look more like sand.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/JwaQ8GQ.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="800" height="320" src="https://i.imgur.com/JwaQ8GQ.jpg" width="640" /></a></div>
<br />
In a completely opposite example denoising the swamp floor textures before using ESRGAN helped them look more like grass with leaves compared to original result that lacked any clear detail. Unfortunately for me GIMP denoising filter often creates dark spots in corners of the image, so I had to manually fix that for each texture, it was very annoying and time consuming.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/20nKYV9.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="800" height="320" src="https://i.imgur.com/20nKYV9.jpg" width="640" /></a></div>
<br />
To finish this on a positive note here is an example were the algorithm and the Misc model did an amaazing job without me doing anything. This is a very cery complex texture yet the ivy came out looking excellent, with defined individual leaves.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/zIkGWzu.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="800" height="320" src="https://i.imgur.com/zIkGWzu.jpg" width="640" /></a></div>
<br />AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com9tag:blogger.com,1999:blog-631094110953668813.post-2630175945023778142019-10-27T16:55:00.003+01:002020-02-16T23:57:02.994+01:00Dungeon Siege - high resolution textures (ESRGAN) - Part 1<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/E5aCWlj.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="640" data-original-width="800" height="320" src="https://i.imgur.com/E5aCWlj.png" width="400" /></a></div>
<br />
I spent several days upscaling Dungeon Siege textures using AI image upscaling ESRGAN. The initial plan was to just do Castle Ehb, but after I got great results on grass textures I got carried away. The end result is a texture pack that is 900 MB in size and contains 500 textures. Since the algorithm increases width and height of texture by 4, this means 16 times increase in surface and file size. The areas I worked on are Farmlands, Stonebridge, Glacern (only buildings and items) and upper parts of Castle Ehb. A lot of time went into this, since there was a lot of experimentation at the beginning and a lot of bottlenecks slowing the whole process down. After all the work it is still just around 15-20%(if not less) of the textures that have been enhanced.<br />
<br />
You can see the final results in game in the video below (watch in fullscreen at 1080p to see the difference more clearly) or you can see direct comparison of textures in the next section. You can download the texture pack from ModDB.<br />
<br />
<div style="text-align: center;">
<span style="font-size: x-large;"><b><a href="https://www.youtube.com/watch?v=HL8F0Tdh_YY" target="_blank">COMPARISON VIDEO</a></b></span></div>
<br />
<div style="text-align: center;">
<span style="font-size: x-large;"><b><a href="https://www.moddb.com/games/dungeon-siege/addons/dungeon-siege-high-resolution-textures" target="_blank">DOWNLOAD</a></b></span></div>
<div style="text-align: center;">
<br />
***</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<span style="font-size: large;"><b>HOW IT WAS MADE</b></span></div>
<br />
Dungeon Siege modding tools can be found here:<br />
<a href="https://sites.google.com/view/chickengeorgemods/modding" target="_blank">https://sites.google.com/view/chickengeorgemods/modding</a><br />
<br />
I used this tutorial to setup ESRGAN:<br />
<a href="http://alphagarg.blogspot.com/2019/01/esrgan-neural-network-ai-for-upscaling.html" target="_blank">http://alphagarg.blogspot.com/2019/01/esrgan-neural-network-ai-for-upscaling.html </a><br />
<br />
Various upscaling models can be found here:<br />
<a href="https://upscale.wiki/wiki/Model_Database" target="_blank">https://upscale.wiki/wiki/Model_Database </a><br />
<br />
The vast majority of textures were upscaled using the MISC model. This model gives great results on wood, stone, bricks, grass mixed with dirt, etc... Below are several direct comparisons of the textures themselves. In top-left corner is the original texture in its original size, they are 128x128 or 256x256 pixels. Then left is that texture upscaled 4 times using linear filtering like in the game and on right is the new ESRGAN texture.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/YdKZh3H.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="800" height="320" src="https://i.imgur.com/YdKZh3H.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<i>Example of </i><i>MISC model working well on complex textures containing ground, wood and grass.</i></div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: center;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/orDjGFJ.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="800" height="320" src="https://i.imgur.com/orDjGFJ.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<i>MISC model gives wood textures a lot of new fine detail.</i></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/w86w3Uj.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="800" height="320" src="https://i.imgur.com/w86w3Uj.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/YP2OHOl.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="400" data-original-width="800" height="320" src="https://i.imgur.com/YP2OHOl.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<i>Stone and bricks get their usual roughness of the surface (MISC).</i></div>
<br />
<div style="text-align: left;">
[MISC model sometimes gets carried away. Some stone wall textures become too
rough and grainy and outlines of individual rocks become less defined.
That is why I sometimes used the MANGA109 model as well. This model
gives "cartoony" results and is not good for realistic textures, but its
advantage is that it enhances the lines. So what I would do is; take
the MANGA109 result, increase the brightness and contrast by just few
percent to further enhance the lines, then reduce the
transparency/opacity in GIMP to about 60% and copy that texture over the
MISC result. This results in more defined lines and also reduces the
roughness of the original MISC result. This was used on some rock and
brick walls and some wood floor textures].*<br />
<br />
* This method was replaced by simply de-noising the original texture before using ESRGAN.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<i> </i><a href="https://i.imgur.com/UXFvqB9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="267" data-original-width="800" height="211" src="https://i.imgur.com/UXFvqB9.png" width="640" /></a></div>
</div>
<div style="text-align: center;">
<i>MANGA109(left), </i><i>MISC(right) and final mixed version in the center.</i></div>
<br />
The MANGA109 model gives great results on various carpets. The problem with this model is that it was trained on JPEG images, so it can produce some artifacts and noise, but this noise is actually good for carpets, since they are not a smooth surface to begin with.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/UUqXxLG.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="512" data-original-width="512" height="320" src="https://i.imgur.com/UUqXxLG.png" width="320" /></a></div>
<div style="text-align: center;">
<i>MANGA109 model was great for carpets.</i><i> </i></div>
<br />
<div style="text-align: center;">
<span style="font-size: large;"><b>UPSCALING FAILURES</b></span></div>
<br />
The quality of results depend on the quality of the upscaling model used and the size and quality of the texture itself. There is a lack of specialized upscaling models. By specialized I
mean models trained on specific texture types like wood, stone walls,
grass, leaves, ground, carpet, old architecture, windows, etc... This
will probably improve over time when new upscaling models get made.<br />
<br />
Many of the textures in Dungeon Siege are very low resolution, which means the
upscaling algorithm does not have enough information to recognize specific
patterns so it can enhance them and add new detail, so it just creates a
mess**. There is nothing that can be done about it, unless an artists
makes new textures. For example Dungeon Siege maps are full with various vegetation, but no model gave good results for those.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/R4hPwa7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="512" data-original-width="256" height="400" src="https://i.imgur.com/R4hPwa7.png" width="200" /></a></div>
<div style="text-align: center;">
<i>This carpet texture is too low resolution and upscaling gives poor result (MANGA109).</i></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/bDtyaLa.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="512" data-original-width="512" height="320" src="https://i.imgur.com/bDtyaLa.png" width="320" /></a></div>
<div style="text-align: center;">
<i>The algorithm fails to recognize the rock surface under the grass and creates a mess (MISC).</i><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/9dLxoQI.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="512" data-original-width="512" height="320" src="https://i.imgur.com/9dLxoQI.png" width="320" /></a></div>
<i>GROUND model creates good grass, but also turns ground/dirt to grass.</i><i> </i><br />
<br /></div>
<div style="text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/A2lXinp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="512" data-original-width="512" height="320" src="https://i.imgur.com/A2lXinp.png" width="320" /></a></div>
<div style="text-align: center;">
<i>Swamp textures lack any clear detail, so the upscaling gives poor results.</i></div>
<br />
** Carpet, rock and swamp eventually did give good enough results by
simply de-noising the original texture before using ESRGAN.<br />
<br />
<div style="text-align: center;">
<span style="font-size: large;"><b>MANUAL ENHANCEMENTS</b></span></div>
<br />
Sometimes you need to help the algorithm a bit. When the result is too grainy and rough you can smoothen it out a bit by denoising the original texture in GIMP before the upscaling process. If the results are a bit blurry then adding a bit of HSV noise to those areas in the original texture can help sharpen those areas in final upscaled texture. This works best with wood or stone textures. In some cases (for example castle marble textures) I had to manually straighten out some lines on the original texture and also repeat the uspcaling process on a downscaled upscaled texture and also straighten the lines manually again. Sometimes you also have to be creative and use elements from another texture to enhance a different one.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/8NS6mRw.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="320" data-original-width="800" height="256" src="https://i.imgur.com/8NS6mRw.png" width="640" /></a></div>
<div style="text-align: center;">
<i>Fixing texture by adding straw manually.</i></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/clIFSNc.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="640" data-original-width="512" height="320" src="https://i.imgur.com/clIFSNc.png" width="256" /></a></div>
<div style="text-align: center;">
<i>Algorithm made the face on this texture unrecognizable, so I used a face from another texture.</i></div>
<br />
<div style="text-align: center;">
<span style="font-size: large;"><b>BOTTLENECKS</b></span></div>
<br />
There are many things slowing down the whole process:<br />
- Since I don't have a Nvidia GPU I have to do the upscaling on my CPU which is a very slow process. For a 128x128 texture it takes around 45 seconds and for a 256x256 more than 3 minutes on a i5-4690k.<br />
- Original textures are in a custom RAW format and only available converters are from RAW to BMP and PSD, and from PSD back to RAW. The ESRGAN upscaling program does not work with PSD. So I need to convert original RAW files to BMP, then upscaled results from PNG to PSD, and finally PSD to RAW.<br />
- Another problem is that textures have an alpha channel which is lost during the BMP conversion. So for each upscaled texture I have to manually add an alpha channel***. For textures that are partially transparent, like windows or spider web, I also have to extract the alpha channel, upscale it separately and then add it back in.<br />
- The things already mentioned under "Upscaling failures" and "Manual enhancement".<br />
<br />
*** Program called "xnconvert" can be used to do this on multiple textures at once.<br />
<br />
<div style="text-align: center;">
<span style="font-size: large;"><b>FUTURE UPDATES</b></span></div>
<br />
I don't know if I will upscale the whole game, after all this work I need a break from this. It takes too much time and some textures give poor results like forest, jungle and swamp floor textures. IMO for those I could resize the final results by half, so the flaws are less noticeable and textures would be at least a bit sharper. I think good results could be achieved for snow and desert terrain textures. I think icy caverns don't need to be upscaled, since ice is supposed to be a bit blurry. Some dungeons, like Wesrin Cross, also have very poor textures that lack detail so the algorithm doesn't really do much good.AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com2tag:blogger.com,1999:blog-631094110953668813.post-76167808508535555152019-09-02T00:45:00.000+02:002020-05-05T11:17:53.856+02:00Fixing a GPU by baking it in an oven - It actually works !<br />
Back in May I was starting to have issues with my GPU. The monitor would suddenly turn black and few seconds later the computer would freeze. It would happen very rarely and after reconnecting the GPU and the cables everything would be fine. I thought it was some loose contact somewhere. But then one day after it happened I couldn't boot into Windows and in BIOS the screen was full of artifacts. My i5-4690k has an integrated GPU, so I could easily confirm it was my GPU, a Sapphire Dual-X R9 270X OC (2 GB) from 2013. It is an old card, but still good enough for me. This happened while I was playing Claw, a 2D platformer from 1997... not a very honorable death for a 2013 card.<br />
<br />
I was already looking at the second-hand market and contacted few people to buy a used RX 570, when I read about people baking their GPUs in an oven and fixing it. Since the GPU is 6 years old, out of warranty and obviously broken, and I have an old oven in the garage that is barely ever used, I decided to give it a chance.<br />
<br />
I preheated the oven to 190°C, put the GPU board inside and baked it for 8 minutes. Then I opened the oven slowly and let it cool down inside. People warned about being careful not to cool down the GPU too fast, because it could cause cracks in the solder. Also be sure to open all doors and windows, because it will smell of solder.<br />
<br />
Since I didn't have thermal paste, for a quick test I put it in the computer without the cooler, I just put a case fan to cool it and was monitoring the temperatures. To my big surprise the artifacts were gone and I could boot to Windows again. Then I started Furmark and it would crash right at the start, even though the temperatures were still low. Luckily after getting thermal paste and mounting the cooler it worked fine. My guess is there is still some bad contact between the GPU chip and the board, but by mounting the cooler and adding pressure the contact is now stable.<br />
<br />
It has been three months already and it still works. I have played and finished few games and even ran some benchmarks. Only once did I get that black screen, about a month ago, but it didn't repeat again.AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-53906182015337220202018-10-12T00:16:00.001+02:002018-10-12T00:16:25.709+02:001 000 000 views on YouTube !About a month or two ago my YouTube channel reached 1 000 000 views ! When I uploaded my first few videos in 2010 I remember being excited reaching 100 views. I guess if I enabled monetisation I might have made a bit of money, but that was never the goal, I just wanted to share what I was working on.
<br />
<br />
<a href="https://www.youtube.com/channel/UCXLuquV1c8EnfQWJ_am21oQ">My YouTube channel</a>
<br />
<br />
Around 80% of those views are from The BloodCrafter video, a Minecraft joke made in 2011 that often went viral over the years. I made that thing in one afternoon, while other projects like Serious Sam 2D and Quake 2D, which took months to finish, have far less views, but still a respectable number.
<br />
<br />
To celebrate these 1 000 000 views I have prepared... nothing. Even this blog post took me few months to finally write. Everything is in a vegetative state. The Broken Mug Engine and the Quake 2D remake in that engine are not legally dead, but progress is extremely slow and it will never be as polished as I would like it to be. I fix a thing or two every few months when I'm bored of doing other things. The original campaign can be finished, but there are bugs all over the place, mostly because all new features I would make, I would leave unfinished and the project grew to a size that is very hard for me to manage. Also it doesn't help that the forums where I have been posting updates about these projects over the years have been shutting down left and right, I will have no one to share this with, but strangers.AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-55621037376111240522017-05-14T02:38:00.001+02:002017-05-27T10:30:54.204+02:00Chrome and Chrome SpecForce - Visual Fidelity (unofficial patch)Another year, another patched old game(s). This time it is Chrome and the expansion/prequel Chrome SpecForce. All I wanted to do is play in 1080p with a FOV that would not give me headaches. Then I discovered Java source code that came with the games. Fix here, fix there, and is basically a whole patch that should be usable to others too.<br />
<br />
The goal of this "patch" is to enable the games to be played in widescreen resolutions, ultra widescreen, multi monitor setups and in 4K and above by fixing text rendering and FOV issues and properly scaling some HUD elements. Another goal was to increase the visual fidelity of the game by forcing the game to render highest quality assets even when they are far away from the player. Only assets that will actually be changed are the HUD map textures. No gameplay changes have been made. Jackfuste from WSGF helped fix all the FOV issues and I used HUD map textures for Chrome from Chrome Widescreen Mod(Chrome HD Fix).<br />
<br />
I have uploaded it to ModDB and there are more details and a list of changes there and in the included change log file. I wont post it all again here. Detailed instructions are also included.<br />
<br />
<div style="text-align: center;">
<span style="font-size: large;"><a href="http://www.moddb.com/games/chrome/downloads/chrome-and-chrome-specforce-unofficial-patch" target="_blank">Chrome and Chrome SpecForce - Unofficial patch (ModDB)</a></span></div>
<div style="text-align: center;">
<span style="font-size: large;"><a href="http://www.mediafire.com/file/qxgdmy61fuyhbkx/Chrome+and+Chrome+SpecForce-Visual+Fidelity_FIN.rar" target="_blank">MediaFire (alternative download link)</a></span></div>
<div style="text-align: center;">
<span style="font-size: x-small;"><i>md5:<span class="summary">d4acfc676f0308ef65cea2ce18647199</span></i></span>
</div>
<br />
Here is a short video comparison:
<br />
<br />
<div style="text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/h3qSGN8xPpQ/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/h3qSGN8xPpQ?feature=player_embedded" width="320"></iframe>
</div>
<br />
Here are some before/after screenshots (move the slider):
<br />
<br />
<iframe class="juxtapose" frameborder="0" height="400" src="https://cdn.knightlab.com/libs/juxtapose/latest/embed/index.html?uid=76080596-383d-11e7-a6aa-0edaf8f81e27" width="100%"></iframe>
<iframe class="juxtapose" frameborder="0" height="400" src="https://cdn.knightlab.com/libs/juxtapose/latest/embed/index.html?uid=1b5edb6a-383d-11e7-a6aa-0edaf8f81e27" width="100%"></iframe>
AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-82470393827751998992017-03-11T12:36:00.001+01:002017-03-11T12:36:42.406+01:00Skeletal animation editor - ghostingI added ghosting to my animation editor, so it is much easier to make animations and adjust individual frames, since I can see previous(red) or next(blue) frame of animation too: <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/VTg6i59.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://i.imgur.com/VTg6i59.png" width="185" /></a></div>
<br />
I can also render and preview all frames at once:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/wvxbxzw.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="132" src="https://i.imgur.com/wvxbxzw.png" width="640" /></a></div>
<br />AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-79054852141669634342017-03-06T04:07:00.001+01:002017-03-06T04:07:49.560+01:00Simple animation interpolationI added simple animation frame interpolation, with basically single line of code, to make the animations smoother:<br />
<br />
current_angle = last_frame_angle + (time_elapsed_since_last_frame/frame_time)*(next_frame_angle-last_frame_angle)<br />
<br />
Left is the original animation, right is with interpolation between frames, both slowed down:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/f8Hknfw.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="192" src="https://i.imgur.com/f8Hknfw.gif" width="320" /></a></div>
AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-34597362417169432562016-12-19T13:59:00.002+01:002016-12-19T14:11:59.736+01:00Box2D ninja rope<br />
I recently played a game called BEEP which had a grappling hook mechanic. The game used Box2D, so I wanted to figure out how they did it. After figuring out a combination of revolute and prismatic joints is the best solution, I also wanted to make a ninja rope like in Worms games, where you can move up/down the rope, stand on the rope like it is a pole and the rope wraps around the terrain. I didn't manage to make it perfect, but it kind of works.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="270" src="https://www.youtube.com/embed/YNhjAPZNzxI" width="480"></iframe>
</div>
<br />
<div style="text-align: center;">
<span style="color: #6fa8dc;"><span style="font-size: large;"><b>Swinging</b></span></span></div>
<br />
1. Rope joint method<br />
<br />
The easiest method is to just create a new rope joint connecting the player and terrain body and Box2D will handle the rest. There are two problems with this method:<br />
<br />
a) Since it is a rope nothing is stopping the player to move closer to the point where rope connects to the terrain. The rope just stops the player from moving further away than what is defined with joint's maximum length (SetMaxLength()) variable. This makes it impossible to stand on the rope.<br />
b) The player can't move up or down along the rope. The joint's maximum length can be changed after it is created, but that will either; try to move the player "by force" upwards if it is changed to lower value even if something is blocking the way(might even just teleport it instantly), or the player will just fall down a bit if the rope is changed to be longer.<br />
<br />
2. Distance joint method<br />
<br />
Alternatively a distance joint can be used instead of a rope joint. The difference is that the player body will not be able to move closer to where rope connects to the terrain or fall down, since the joint always tries to maintain the same distance. This is actually closer to the ninja rope behavior in Worms than the rope joint option and you can stand on the rope using this method. SetLength() can be used to "move" the player along the rope, but similar to the rope joint it tries to push the player to new position even if there is something in the way. <br />
<br />
3. Chain method<br />
<br />
This is also a simple method, but requires a lot more work. Simply create many small bodies between the player and the terrain body and connect everything with revolute joints. The problems:<br />
<br />
a) The rope is a bit hard to control, moves around too much and can stretch. In games like Worms or Bionic Commando the rope isn't behaving very realistically, more important was giving the player intuitive control over it.<br />
b) You can't move up/down the rope or stand on it.<br />
<br />
The positive thing about this method is that the rope can wrap around terrain without any additional coding.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/PGNiVJX.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="352" src="https://i.imgur.com/PGNiVJX.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
Tips:<br />
1) For some reason joints are more stable if the bodies connected have higher density value, but the downside is that heavier rope is harder to control.<br />
2) Enable joint motors and set torque to very small value and set the speed to zero, so the chain stops swinging sooner.<br />
3) Connect the terrain and the player with a rope joint to prevent the chain from stretching too much. The max length should be same as the length of the entire chain or just a tiny a bit longer, depending how much do you want to allow it to stretch.<br />
4) Since all the chain bodies would by default have zero linear and angular velocity when created, it would slow down the moving player when initially created. I don't know how to calculate the initial values of each link based on player velocity and stuff, but simply giving all the bodies the same velocity as the player at the moment of creation works good enough.<br />
<br />
4. Prismatic and revolute joint method<br />
<br />
The best way to make Worms like ninja rope using Box2D is using a prismatic joint on a rotating body:<br />
a) With a prismatic joint the body is limited to moving/sliding along an axis and that is exactly what we need. <br />
b) Using the joint's motor we can make the attached body move up/down without breaking the physics simulation and if some object is in the way and blocking the movement it will behave normally (unless we set the motor torque to an insanely huge value).<br />
c) Using a motor with a high torque we can fix the players position on the rope, so the player can "stand" on the rope, just like in Worms games.<br />
<br />
The rope will have three parts:<br />
<br />
1. Rope/hook (long thin triangle) - a body which is connected to terrain using a revolute joint, so the whole thing can swing.<br />
2. Slider (rectangle) - a body connected to the hook using a prismatic joint, so the player can move up/down the rope using the joint's motor.<br />
3. Rotor (yellow circle) - Usually in Box2D games the player body has a fixed rotation, so it always stays upwards. We can't connect it directly to the slider, because with fixed rotation it wont allow connected bodies to rotate freely. There needs to be a body between the player and slider connected to both with a revolute joint, so the player can maintain the fixed rotation, but the rope can still freely rotate. If you have a player that can rotate freely, this isn't needed and can be attached directly.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/NV7Zj87.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="179" src="https://i.imgur.com/NV7Zj87.png" width="640" /></a></div>
<br />
<br />
<div style="text-align: center;">
<span style="color: #6fa8dc;"><span style="font-size: large;"><b>Wrap around terrain</b></span></span></div>
<br />
It is important to note that only one segment of ninja rope is fully active at any given moment. Basically the swinging part will work as described above in the method 4, and the rest of the rope are just static points with a line rendered between them.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://i.imgur.com/rBbkLyE.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="446" src="https://i.imgur.com/rBbkLyE.png" width="640" /></a></div>
<br />
<br />
a) How to detect when a corner is hit and split the rope ?<br />
<br />
One method is to use the rope/hook part from method 4. It needs to be very long and thin, and needs to be a bullet body. When bullet bodies collide in Box2D you get the exact point of impact in PreSolve() callback function which you can use to determine where the rope needs to be split.<br />
<br />
- The rope needs to collide with the terrain, but shouldn't bounce of the terrain, we just need the collision point. So in the PreSolve() callback the contact needs to be disabled with contact->SetEnabled(false).<br />
- The rope should not be connected directly on the collision point, because we don't want the tip of the rope/hook to constantly collide around that point while rotating and cause problems. The connection point needs to be a bit outside of the terrain body (see image above).<br />
<br />
When existing rope collides all the rope objects are deleted and the rope is recreated in that collision point. Like mentioned previously; only the last part of the rope is active. The previous connection points are still needed to render the entire rope and to know when to reconnect the parts.<br />
<br />
The downside of using this method is that when the player is moved all the way up the rope, you have all this extra mass bellow him (the player in not the center of mass) that can cause unwanted movement.<br />
The solution is to make the rope/hook body very small, so the center of mass is always the player, and use some other method to find out where the rope hits the terrain.<br />
<br />
b) How to reconnect it all again ?<br />
<br />
Simple; if you swing clockwise and hit something and split the rope, you will have to reconnect only when you swing in the opposite direction and past that point. Use the revolute joint's speed to check the direction(negative is clockwise, positive is counter-clockwise), and you can check if you past that point using a cross product formula:<br />
<br />
<span id="goog_689449734"></span><a href="https://www.blogger.com/"></a><span id="goog_689449735"></span><a href="http://stackoverflow.com/questions/1560492/how-to-tell-whether-a-point-is-to-the-right-or-left-side-of-a-line" target="_blank">http://stackoverflow.com/questions/1560492/how-to-tell-whether-a-point-is-to-the-right-or-left-side-of-a-line</a><br />
<br />
Two last rope points is the line you need to cross, and the point you check is the current player position. If you crossed the line you remove the last rope point and recreate the rope in the last of the remaining collision points. While doing all this splitting and reconnecting you need to keep in mind the total length of the rope, and change the rope/hook body length accordingly.<br />
<br />
<div style="text-align: center;">
<span style="font-size: x-large;"><b><a href="http://www.mediafire.com/file/e4trodrh5qtx04i/BMUG_Engine_PB_5_Ninja_rope.rar" target="_blank">Playable demo</a> </b></span></div>
<div style="text-align: center;">
<span style="font-size: x-large;"><b><a href="http://www.mediafire.com/file/52661xq3xkjo2ca/ninja_rope_stuff.cpp" target="_blank">Source code</a></b></span> </div>
<br />
You can try it out for yourself using the link above. I also uploaded the source code for the rope handling. Not sure how useful it will be, since I just copied it from my game/engine, so don't expect to just copy/paste it into your code and think it will work. Think of it more as a sign of goodwill. Don't forget to read the included README.<br />
<br />
<div style="text-align: center;">
</div>
AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com1tag:blogger.com,1999:blog-631094110953668813.post-9926857470193132312016-10-23T01:00:00.003+02:002016-10-23T01:01:30.340+02:00Random #7 - attack of the view botsThis blog seems to be under "attack" by bots or something. For the last month I'm getting ten times more daily views than the average was. It started on September 30th. Every few hours the statistics shows a spike of 30 new views, and every day the same thing. The views are coming from USA, operating system is Macintosh and the browser is Chrome, but it shows no referring site or anything to pinpoint the source. It has made the statistics data completely useless.AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com1tag:blogger.com,1999:blog-631094110953668813.post-60417385939241629092016-10-03T00:56:00.001+02:002016-10-03T00:56:28.396+02:00Particle effectsHere is a video showing the updated particle system and editor, and some
stuff that can be done with them.<br />
<br />
It was all inspired by Unreal Engine particle system. Particle effects
can contain several emitters and emitter and particle values are not just variables they
are "modules" with "distributions" and stuff to control the values over
time, etc. There are around 30 of these modules; emitter and particle lifetime, particle width, height, speed, direction, color, angle, number of particles on init/on update... Each effect, and even particles, can have dynamic light attached to them. Also, particles can be attached to a Box2D body, but then some of the functions wont work (particle position will be updated by Box2D and not by emitter functions). I also implemented ribbon and beam/line emitters.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="270" src="https://www.youtube.com/embed/c9Pwl61xkPM" width="480"></iframe>
</div>
<br />
<br />
<i>Here is what you can see in the video:</i><br />
<i>- Fireworks - shows "nested" effects. Each particle can carry its own effect(rocket trail) and also can create a new one at the end of its life(explosion).</i><br />
<i>- Text - various line effects. The lightning effect uses a tilemap.</i><br />
<i>- Circles - nothing special, just a bunch of circular effects.</i><br />
<i>- Sparks - shows Box2D enabled particles. Particles change rotation and size based on velocity.</i><br />
<i>- Ribbons - ribbon effect can be attached to other particles or objects.</i><br />
<i>- Flamethrower - shows effect and individual particle lights, and also collision response (creating ground fire on particle-ground contact).</i><br />
<i>- Colored lights - shows particles with colored dynamic light.</i><br />
<i>- Paint explosions - shows creation of decals on contact on static and moving objects.</i><br />
<i>- Particle effect editor - shows how one effect can be made of several particle emitters.</i><br />
<i>- Leafs - shows direction change using a sin wave.</i><br />
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
***</div>
<div style="text-align: center;">
<br /></div>
Updating, saving, parsing, then the editor code itself....
it's well over 5000 lines of code. It all became over complicated and
confusing and I don't know does it even make any sense anymore, I just
lack the knowledge to design such a complicated system. Quake 2D didn't
even have a particle system, it was all hand made and hardcoded, and it
still worked. I have been working on the particle effects until March and then completely
stopped. Then fooled around with Abuse SDL and haven't coded since. I wanted to post this way back in March, but just didn't want to bother anymore.AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-85785773402812681862016-05-09T09:59:00.000+02:002019-05-18T01:17:27.684+02:00Abuse 1996 - SDL port 0.9a<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/CyyNz1p.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="185" src="https://i.imgur.com/CyyNz1p.png" width="640" /></a></div>
<br />
<br />
When I released my Quake 2D demo back in 2012 many people compared it to <a href="http://www.mobygames.com/game/abuse" target="_blank">Abuse, a game by Crack dot Com released in 1996</a>. While I was waiting for my new PC to get fixed(it took months!) I was stuck with a PC bought in 2005. I already played everything I could on it and my gaming options were limited. I found out Abuse was available for free, so I wanted to check it out. It ran in DOSBox at 320x200 resolution and felt like playing a FPS game with very low FOV. Aiming with the mouse was very difficult, because even in fullscreen the mouse was still behaving like it was 320x200 resolution and was too sensitive.<br />
<br />
Reading the included readme file I saw there was a high resolution option, but it seemed to be only available in the shareware version or in editor mode, and the game would automatically turn off the in-game lights, because it would be too demanding for the PCs in 1996 on high resolutions. Not to mention a bug would cause the entire screen to go black the second time a level was loaded. While looking for a fix I found out the <a href="https://archive.org/details/abuse_sourcecode" target="_blank">original source code</a> was released and there were <a href="http://web.archive.org/web/20070205093016/http://www.labyrinth.net.au/~trandor/abuse/" target="_blank">several</a> <a href="http://web.archive.org/web/20051023123223/http://www.webpages.uidaho.edu/~scot4875/" target="_blank">source</a> <a href="http://abuse.zoy.org/wiki/download" target="_blank">ports</a> released during the years, mostly for Linux. Finally <a href="https://github.com/Xenoveritas/abuse" target="_blank">Xenoveritas SDL2 port</a> from 2014 showed up in the search results and was exactly what I needed; a working Windows port, plus it had instructions how to build it.<br />
<br />
After I enabled custom resolutions and fixed the light, I also wanted to extract the textures, so I can use them in my own engine. Then I saw Xenoveritas never finished adding Xbox controller support, so I did it instead... it didn't stop there, and here is the final result in motion:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="270" src="https://www.youtube.com/embed/0Q0SbdDfnFI" width="480"></iframe></div>
<br />
As you can see the game gets pretty intense. It's a classic design where you need to find switches to open new areas, and you need to cleverly use security turrets and destructible walls to fight the enemies. It takes 2-3 hours to beat the game.<br />
<br />
Here is the list of updates in Abuse SDL 0.9a compared to Xenoveritas version from 2014:<br />
<br />
<i>- Enabled custom resolutions and enabled lights on high resolutions</i><br />
<i>- Re-enabled OpenGL rendering to enable vsync</i><br />
<i>- Game screen scaling in window and fullscreen mode using F11 and F12</i><br />
<i>- Enabled some high resolution images from the 1997 Mac OS release</i><br />
<i>- Fixed level music not being played correctly, added "victory" music in the end game screen</i><br />
<i>- Fixed the health power image, fixed mouse image when choosing initial gamma</i><br />
<i>- Added or re-enabled various settings in the config file (borderless window, grab input, editor mode, high resolution images...)</i><br />
<i>- Local save game files and configuration files</i><br />
<i>- Quick load using F9, quick save using F5 on save consoles</i><br />
<i>- Added cheats via chat console: bullettime, god, giveall, flypower, sneakypower, fastpower, healthpower, nopower</i><br />
<i>- XBox360 controller support with rebindable buttons</i><br />
<i>- Updated abuse-tool so it can extract the images in Abuse SPEC files to modern image formats as individual images, tilemaps or a texture atlas with information about image, tile and animation frame sizes and positions</i><br />
<br />
<br />
I only tested the game on my old 2005 PC and the new one, running Windows 32bit and 64bit. I would really appreciate some feedback, so I know it works or not. I would also like to know how playing with the Xbox controller feels, since I plan to use the same controls in my own engine. Please read the included README file for more information, controls and links to previous port releases and other stuff. (NOTE: Since changing sound volume doesn't work, if you don't want music just delete the music folder). You can download the game from this link or on ModDB:<br />
<br />
<div style="text-align: center;">
<span style="font-size: large;"><a href="http://www.mediafire.com/download/pgos1074d3dnmka/Abuse_1996_v0.9a_win32.rar" target="_blank">ABUSE 0.9a WIN32</a></span></div>
<div style="text-align: center;">
<span style="font-size: x-small;">md5: 16E116B753A2142E4AE2BB63C2A4A351</span></div>
<br />
<div style="text-align: center;">
<span style="font-size: large;"><a href="http://www.moddb.com/games/abuse/downloads/abuse-sdl-09a-windows">Abuse on ModDB</a></span></div>
<br />
I already mentioned I wanted to extract the images, so here is an archive that contains all the extracted Abuse images in PNG format, together with information about image name, size and positions of individual frames of animation: <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/arxjKV1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://i.imgur.com/arxjKV1.png" width="273" /></a></div>
<div style="text-align: center;">
<span style="font-size: x-small;"><i>Aliens addon</i></span><br />
<br /></div>
<div style="text-align: center;">
</div>
<div style="text-align: center;">
<span style="font-size: large;"><a href="http://www.mediafire.com/download/tgscbx6yo6t0gr0/Abuse_1996_Textures.rar" target="_blank">ABUSE TEXTURES</a> </span></div>
<div style="text-align: center;">
<span style="font-size: x-small;">md5: 5A2D1E65A2D76C6C0D340F600E2F7B5B</span></div>
<br />
I also used a HMI to MIDI converter to convert the music to MIDI. I didn't convert them to wav or mp3, because different soundfonts give different results when playing MIDI music. You can download the MIDI files here: <br />
<div style="text-align: center;">
<span style="font-size: large;"><a href="http://www.mediafire.com/download/b2tezuvqwg4yyit/Abuse_1996_MIDI.rar" target="_blank">ABUSE MUSIC</a></span></div>
<div style="text-align: center;">
</div>
<div style="text-align: center;">
<span style="font-size: x-small;">md5: 5FC937F71DB047DA9E46961F83016CDA</span></div>
<br />
The source code for Abuse SDL port 0.9a is available on my GitHub page. As I said the game is not fully tested and there are few issues which are described in the README file. The game physics are locked at 15 FPS, and the rendering is a bit slow,
those are two major things I would like to eventually fix. Multiplayer doesn't work, but that is way out of my league:<br />
<br />
<div style="text-align: center;">
<span style="font-size: large;"><a href="https://github.com/antrad/Abuse_1996" target="_blank">ABUSE SOURCE CODE</a></span></div>
<br />
Thank you for playing Abuse! AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com60tag:blogger.com,1999:blog-631094110953668813.post-82247987652070518842016-04-09T20:42:00.002+02:002016-05-12T13:20:04.846+02:00Texture packing algorithm<br />
I was exporting some textures from an old game, and needed an algorithm to pack many small textures into a texture atlas. I found a very nicely explained algorithm on this page and wanted to share, if someone might need something like this:<br />
<br />
<a href="http://www.blackpawn.com/texts/lightmaps/default.html" target="_blank">http://www.blackpawn.com/texts/lightmaps/default.html</a><br />
<br />
There are some other interesting articles from the same guy here:<br />
<br />
<a href="http://www.blackpawn.com/texts" target="_blank">http://www.blackpawn.com/texts</a><br />
<br />
The packing algorithm is so simple, I didn't think it would work. You just create a node with the output texture size and loop trough your images and call Insert() with individual texture's width and height. The node recursively splits itself if its size doesn't match the input, and calls Insert() of the child nodes. The node that gets returned holds the final [x,y] position, and if it returns NULL it means the image couldn't fit.<br />
<br />
The grey lines mark individual textures and animations that I grouped
together in code, so it doesn't all get mixed, but that is another
story.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/LiPA1ha.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/LiPA1ha.png" height="367" width="400" /></a></div>
<br />
<u><b>Tip 1.</b></u><br />
<br />
In the example above I sorted my images according to their size(width*height) before I started to call Insert().<br />
<br />
<u><b>Tip 2.</b></u><br />
<br />
If you look at the examples from the link, you will see the images are stored in an upside-down L pattern starting from top left, so if your output image is too big the input images will be positioned in the L pattern and the rest of the space(bottom right) is left unused. To avoid that;<br />
- I sum the size of all the textures and set node width and height to sqrt(sum), so I have a minimum square output.<br />
- Then I check if some image has width higher than that, if so I take that value for the final node width, so it can fit.<br />
- The final height is some arbitrary huge value. While calling Insert() I keep track of where the bottom corners of the images end up and take the maximum value when creating the actual output image, which, after all this mess, should be more or less a square.<br />
<br />
<b><u>C++</u></b><br />
<br />
Here is my implementation in C++ to spare you 2 minutes of converting the pseudocode. Unfortunately Blogger doesn't have code tags or something to format it properly.<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;"><span style="font-size: x-small;">#include <vector><br /><br />class AR_Node<br />{<br />public:<br /> std::vector<AR_Node> child; <span style="color: #38761d;">//child nodes</span><br /> int x, y, w, h; <span style="color: #38761d;">//position and node size</span><br /> bool image; <span style="color: #38761d;">//image stored in the node</span><br /><br /> AR_Node* Insert(int img_w, int img_h);<br /><br /> AR_Node()<br /> {<br /> this->x = y = w = h = 0;<br /> this->image = false;<br /> }<br />};<br /><br />AR_Node* AR_Node::Insert(int img_w, int img_h)<br />{<br /> <span style="color: #38761d;"> //if we are not a leaf then</span><br /> if(!this->child.empty())<br /> {<br /> <span style="color: #38761d;"> //try inserting into first child</span><br /> AR_Node *newNode = this->child[0].Insert(img_w,img_h);<br /> if(newNode!=NULL) return newNode;<br /><br /> <span style="color: #38761d;">//no room in first child, insert into second</span><br /> return this->child[1].Insert(img_w,img_h);<br /> }<br /> else<br /> {<br /> <span style="color: #38761d;">//if there is already a image here, return</span><br /> if(this->image) return NULL;<br /><br /> <span style="color: #38761d;">//if image doesn't fit, return</span><br /> if(this->w<img_w || this->h<img_h) return NULL;<br /><br /> <span style="color: #38761d;">//if we're just right, accept</span><br /> if(this->w==img_w && this->h==img_h)<br /> {<br /> this->image = true;<br /> return this;<br /> }<br /><br /> <span style="color: #38761d;">//otherwise split this node and create some children</span><br /> this->child.push_back(AR_Node());<br /> this->child.push_back(AR_Node());<br /><br /> <span style="color: #38761d;">//decide which way to split</span><br /> int dw = this->w - img_w;<br /> int dh = this->h - img_h;<br /><br /> if(dw>dh)<br /> {<br /> <span style="color: #38761d;"> //vertical split <br /> //left</span><br /> this->child[0].x = this->x;<br /> this->child[0].y = this->y;<br /> this->child[0].w = img_w;<br /> this->child[0].h = this->h;<br /> <span style="color: #38761d;">//right</span><br /> this->child[1].x = this->x + img_w;<br /> this->child[1].y = this->y;<br /> this->child[1].w = this->w - img_w;<br /> this->child[1].h = this->h;<br /> }<br /> else<br /> {<br /> <span style="color: #38761d;">//horizontal split<br /> //up</span><br /> this->child[0].x = this->x;<br /> this->child[0].y = this->y;<br /> this->child[0].w = this->w;<br /> this->child[0].h = img_h;<br /> <span style="color: #38761d;">//down</span><br /> this->child[1].x = this->x;<br /> this->child[1].y = this->y + img_h;<br /> this->child[1].w = this->w;<br /> this->child[1].h = this->h - img_h;<br /> }<br /><br /> <span style="color: #38761d;">//insert into first child we created</span><br /> return this->child[0].Insert(img_w,img_h);<br /> }<br />}</span></span>AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-65968839687571392272016-04-05T13:29:00.000+02:002016-04-05T13:31:11.632+02:00Random #6 - Youtube channel statisticsThis January my YouTube channel exploded ! Well, at least one video did. My "The Bloodcrafter - Minecraft 2D shooter" video is getting in average almost 1000 views <b>DAILY</b>, and is rapidly approaching 400 000 views, with the channel surpassing 500 000 total views. If I were monetizing this I might have made enough money to buy the actual game :/<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/qi6tTZc.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/qi6tTZc.png" height="353" width="400" /></a></div>
<br />
Other videos are not that successful, and the total view count of all the videos I uploaded in the last two years is only around 15 000, and that number would be much, much lower if Bloodcrafter wasn't attracting so much attention to the channel.<br />
<br />
Since the most popular videos are based on Minecraft, Serious Sam and Quake, and with so many views in the period of over 5 years, the channel statistics are worth looking at to see some trends. I think it would make sense to say that the viewer demographics represent the actual player base.<br />
<br />
The most significant change in the last 5 years is how Minecraft has become more popular among female players. In the first year(2011-2012) only 5 percent of players were female, and the data from last year (2015-2016) shows it is currently at almost 40%. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/Pb4LR47.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/Pb4LR47.jpg" height="280" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/ktNF0se.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/ktNF0se.jpg" height="278" width="400" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The percentage of Serious Sam female viewers/players jumped from 5% to
around 16%. Quake 2 continues to be a "man's" game, probably because 90s
girls weren't interested in it, and new generations don't even know
about it, since the series is dead since 2005. But, looking at Serious
Sam, which is a similar game, the new entries don't help much. Serious Sam continues to be most popular in Eastern Europe. </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/6WC4Ro0.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/6WC4Ro0.jpg" height="280" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/KrECLhC.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/KrECLhC.jpg" height="280" width="400" /></a></div>
<br />
Other videos share the same faith like Quake, it's such a sausage
festival that YouTube doesn't even want to display the statistics and it
shows an error. Since most of them are about video game development, and
are shared on some game development and gaming forums, my conclusion would be that we wont see a rapid increase in the number of female game developers any time soon... unless it is forced.<br />
<br />
Another sad statistic is Linux. I only have the data starting from January 2013, and they show only 1.3% of PC viewers are on Linux, and 1.8% use Mac. The stats from this blog are a bit more positive, where 5% of readers are on Linux, and 5% on Mac (but these are overall numbers, not just for PC).AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-41144016163962893832015-12-21T19:57:00.000+01:002015-12-21T20:05:32.824+01:00Particle emitters #3I think it is the third time already that I am rewriting my particle system. There is always some effect I want that is missing; lightning, velocity based deformation, pulsating size or color, physics...<br /><br />Look at how many variables there are already ! And just when I thought I was done, I realized everything is flawed AGAIN. It's the randomization of values ! Those also need more control, so they can change like a sin wave, or linearly, or randomly, or in discrete values...<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/A5gaV8p.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/A5gaV8p.png" height="592" width="640" /></a></div>
<br />AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-52356245335571796232015-12-08T11:42:00.000+01:002015-12-08T11:42:03.091+01:00Dynamic 2D light and shadowsThis video shows my dynamic 2D light system based on Box2D (nothing to do with Box2DLights library) and Clipper:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="270" src="https://www.youtube.com/embed/b1xP75VsOc8" width="480"></iframe>
</div>
<br />
<br />
This is how it all works:<br />
- light is a textured quad/polygon<br />
- Box2D is used to get all the sprites inside the light polygon by either using light as a sensor, or using b2World::QueryAABB()<br />
- for convex shapes visible edges are calculated using a dotproduct of light and edge normals<br />
- for concave shapes(which can only be chains in Box2D) all edges are considered visible<br />
- shadow polygons are created by extending visible edges<br />
- using polygon clipping library called <a href="http://www.angusj.com/delphi/clipper.php" target="_blank">Clipper</a> a "difference" operation is performed between the light polygon and shadows to get the final light polygon<br />
- UV mapping is performed on the resulting vertices<br />
- the resulting polygon is rendered as a GL_TRIANGLE_FAN<br />
<br />
No raycasting is performed, which you usually find in tutorials.<br />
<br />
The "depth" mask uses the green channel to mark which pixels should be
illuminated, and for the intensity (ex. transparent smoke should be
illuminated less than a solid surface). Blue channel is used for depth,
and works basically the same. It's not perfect, but I can get some nice
effects with it. <br />
<br />
Soft shadows are generated by rendering the lights on a FBO smaller than the screen size and rendering it with a blur shader. <br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/rhF9suC.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/rhF9suC.png" height="332" width="640" /></a></div>
AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-34183601322089816502015-11-25T04:09:00.002+01:002015-11-25T04:17:25.017+01:00Depth maskI realized that, since I am rendering a mask to use it for light rendering I could as well render it in different color values and use it as a depth mask too. Layers that are further away are rendered in darker tones of the color for the mask, and when I use multitexturing to mix the mask and light FBO I multiply the final light values with the values of the mask and get light with different intensity:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/UwXlCqB.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/UwXlCqB.png" height="372" width="640" /></a></div>
<br />AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-29854938319118868752015-11-21T05:17:00.000+01:002015-11-21T05:17:01.409+01:00Light and magicUsing FBOs, multitexturing, different blending modes and few simple shaders I managed to make very simple lighting system. I think the end results look pretty good:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/5qcRsuZ.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/5qcRsuZ.png" height="202" width="640" /></a></div>
<div style="text-align: center;">
<i>No light</i></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/69uYGhf.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/69uYGhf.png" height="208" width="640" /></a></div>
<div style="text-align: center;">
<i>Example 1 - blue tint</i></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/ZJjepnY.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/ZJjepnY.png" height="204" width="640" /></a></div>
<div style="text-align: center;">
<i>Example 2 - orange tint</i></div>
<br />
What were the requirements:<br />
a) sprites in a layer should be illuminated with light of different colors<br />
- front layers should block the light from the back <br />
b) light should "bleed" over the edges of front layers (eg. solid walls)<br />
- not affect back layers that are in distance (eg. sky)<br />
c) different layers should be able to be illuminated seperatelly<br />
d) layers should also be able to get darker<br />
<br />
a) To illuminate sprites in a certain layer using some color I render them on a black FBO using a shader that colors the pixels of the sprite's texture in a set color. Then I can render that FBO over the final scene using (GL_DST_COLOR,GL_ONE) blend mode and color the sprites. But, not so fast. <br />
<br />
After the sprites that will be illuminated are rendered on the light FBO
in color, I also render the front layers that should block that light
in black to cover up those pixels. In the examples above the outside light should be blocked by the ground and the building on the left, the light from the building should be blocked by the building walls and ground.<br />
<br />
b) Notice how the edges of the darker front sprites are also colored. To get the "bleeding" effect I blur the light FBO, so the light expands a bit:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/nuRz2uk.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/nuRz2uk.png" height="242" width="400" /></a></div>
<br />
To know which layers the blurred light should affect and which not, I need a FBO which serves as a mask. On that FBO I render all the sprites on which the final blurred light can fall, and using multitexturing and a shader I only render the pixels from the light FBO where the pixel is "on" on the mask FBO. Since the "sky" is not rendered on the mask, it wont be affected by the light, but, like seen above, it affects the front layers, which were rendered on the mask.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/E2cdWvK.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/E2cdWvK.png" height="193" width="640" /></a></div>
<div style="text-align: center;">
<i>Mask FBO - green means light should be rendered there</i></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/Nmrbqky.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/Nmrbqky.png" height="267" width="400" /></a></div>
<div style="text-align: center;">
<i>The sky didn't turn blue, but the wall on the bottom-left did</i></div>
<br />
c) As you can see on the first images the outside area and the area inside the building on the left are illuminated differently. I can use the technique above on as many layers I want, then take the light FBO of the certain layer and render it all on the final light FBO using (GL_SRC_ALPHA,GL_ONE) blend mode to get alpha blending, then I can <u>finally</u> render that light FBO over the final scene using (GL_DST_COLOR,GL_ONE) blend mode.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/VHMbj1l.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/VHMbj1l.png" height="204" width="640" /></a></div>
<div style="text-align: center;">
<i>Final light FBO is a mix of 2 FBOs</i></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
d) To darken certain layers(ground and building walls on the images above) I can take the above light FBO and render it over the scene using a mask where I previously rendered all the layers/sprites that should be darken up. Then I render the "dark" pixels where the pixel of the mask FBO is "on". Since the light FBO was already blurred and stuff, I get a nice fade to black at the edges, by using the RGB color values of the light FBO pixels to determine alpha value for the final dark pixel. Here the (GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA) blend mode is used.</div>
<div style="text-align: left;">
</div>
AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0tag:blogger.com,1999:blog-631094110953668813.post-29678349318737637652015-10-13T15:23:00.002+02:002015-10-13T15:27:27.614+02:00Linux ?Using Eclipse I managed to compile and run the game on Ubuntu/Linux inside VirtualBox. I have little experience using Eclipse, virtual machines and not to mention Linux, but it works more or less.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.imgur.com/2L74EOc.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://i.imgur.com/2L74EOc.jpg" height="401" width="640" /></a></div>
<br />
There are some problems:<br />
<br />
- I can't load shaders and make FBOs, but that is probably because in VirtualBox I can only get OpenGL 2.1.<br />
-
FMOD doesn't work in the game and even the examples provided with the
API don't work. It plays a sound for only one frame and turns it off. It could be a
problem with the library, the way I installed the library, or the audio
drivers in VirtualBox.<br />
- Game crashes randomly.AntonioRhttp://www.blogger.com/profile/11929509722129102044noreply@blogger.com0