FreeGameDev Planet - Development

Also check out the games planet.

August 19, 2017

Urho3D

Urho3D 1.7 release

Source package

Binary package

Porting notes

If you are migrating your existing project from earlier release version of Urho3D, please read these notes.

Changelog

  • Inverse kinematics support.
  • Bullet RaycastVehicle support.
  • AppleTV platform support.
  • WebAssembly support on the Web platform.
  • IME support on Linux platform.
  • Several font rendering improvements and TypoGraphy sample.
  • WebP image loading support.
  • Sparse navigation meshes and navmesh streaming support.
  • AutoRemove bool removed. Replaced with more general AutoRemoveMode mechanism.
  • Free functions supported in attribute accessors.
  • IntVector3 class.
  • EnumAttributeAccessorImpl is now compatible with enum classes.
  • Use default continuous physics & substepping values for Box2D world.
  • Node-specific 2D physics collision events.
  • Improved Box2D joint handling.
  • Use GetDerivedComponent() when getting PhysicsWorld2D to allow subclassing it. PhysicsWorld2D members no longer private also for this reason.
  • ApplyLinearImpulseToCenter() function in RigidBody2D.
  • Additional info exposed in 2D physics events.
  • CollisionShape2D scale allowed to be signed.
  • Refactor PhysicsWorld2D contact info.
  • ParticleEmitter2D can be made to stop / restart emitting.
  • CSV and base64 encoding options when loading TMX files.
  • Several tilemap / TMX file improvements.
  • Improved convex hull debug draw.
  • Bool & int shader parameters on D3D11 / OpenGL.
  • Maximum extrusion distance for directional light shadows.
  • Shader compilation defines added to materials.
  • Shader compilation defines added to renderpath commands.
  • Shader compilation define exclusion mechanism in Pass.
  • Multisampled rendertargets.
  • Mipmapped rendertargets.
  • Alpha-to-coverage can be enabled in pass or material. Requires D3D11 or OpenGL.
  • Line antialiasing support.
  • Optional soft particles support.
  • Improve VSM shadows by moving z/w divide to pixel shader.
  • Anisotropic-nearest filtering mode, when supported.
  • Optional per-texture max anisotropy setting.
  • Physical light values support.
  • Area light support.
  • Multisample option for VSM shadows.
  • Shader cache location is configurable, and defaults to a user-writable directory.
  • Renderer events for screen buffer allocation & global shader parameters having been set.
  • Renderer event for all views having been rendered.
  • DecalSet optionally sizes vertex & index buffer only based on use.
  • New face camera mode in BillboardSet & Text3D.
  • Support defining neighbor terrains to avoid LOD discontinuities.
  • AnimationController internal control structures can be accessed as part of its public API.
  • AnimationController can be queried if any animation is playing on a layer.
  • Allow to get animation tracks by index.
  • Custom projection matrix support.
  • Implement GetMultiSampleLevels() on OpenGL.
  • Monitor and refresh rate options for Graphics::SetMode().
  • Allow unclamped morph weights.
  • Static helper function for calculating VertexBuffer element offsets.
  • Model metadata support.
  • PBR improvements.
  • Clean up PBR shaders & techniques; do not require tangents in PBR shaders unless using normal mappings.
  • Possibility to set mouse mode or visibility before Input class initialization.
  • Mouse centering / position setting moved to Input public API.
  • Seek method for audio streams.
  • Anchors and pivots can optionally be specified for UI elements.
  • ProgressBar UI element added.
  • UI root element custom size support.
  • UIElement child XML loading returns created child instead of success bool.
  • Add delta parameter to UI element resize event.
  • SDF font supersampling.
  • FontType enum exposed to public API.
  • NAVIGATIONPUSHINESS_NONE mode in CrowdAgent.
  • NavArea solid debug geometry.
  • To/from string conversions in JSONValueType / JSONNumberType.
  • Add function to test for Rect / Rect intersection.
  • Resize overloads in Vector / PODVector.
  • Remove ineffective static TypeInfo checking functions.
  • Node & UIElement child query function overloads that return a collection.
  • Node IsChildOf() function.
  • Temporary parameter added to Node CreateChild() function.
  • Sprite2D can define its draw & texture rectangles.
  • UniquePtr class.
  • Several math API functions added.
  • Stable random generator added.
  • Add FloatToRawIntBits function.
  • Variant can hold Rect objects.
  • Variant can hold 64-bit integers.
  • Mipmap manipulation support in Image.
  • Image class SaveDDS() function.
  • Text3D GetHeight() function.
  • Console auto-completion.
  • Console text highlighting according to message type.
  • XMLFile GetOrCreateRoot() function, and XMLElement GetOrCreateChild() function.
  • Urho3DPlayer attempts to read CommandLine.txt from resource system on all platforms, if cannot read from filesystem.
  • Improve use of SDL_Init() so that Context keeps track of initialized SDL subsystems.
  • IES cookie generation in RampGenerator.
  • AbstractFile as a parent class for those that implement both Serializer & Deserializer.
  • Allow specifying child node by name in attribute animation paths.
  • Functions to get rotation axis & angle in Quaternion.
  • Improved AngelScript API dump.
  • Consts exposed to AngelScript API.
  • OS query functions added to ProcessUtils.
  • Add resource to cache before sending background load event.
  • Prevent sending event to subscribers added during event handling.
  • Prevent rendering of unnecessary shadow maps.
  • Prevent rendering of deferred light volumes which would be masked out due to lightmask being only 8-bit in deferred rendering.
  • Move “cold” parts of Node into NodeImpl class to improve performance.
  • Populate rapidjson value before adding to parent.
  • Update to AngelScript 2.31.2.
  • Update to FreeType 2.7.1.
  • Update to SQLite 3.18.0.
  • Update to LibCpuId 0.4.0.
  • Update to Box2D 2.3.2.
  • Update to Assimp 3.2.
  • Update to LZ4 1.7.5.
  • Update to Bullet 2.86.1.
  • Build system: ensure empty CMAKE_OSX_DEPLOYMENT_TARGET on iOS build.
  • Build system: auto-disable PCH on Android Clang build.
  • Build system: prefer CMake’s regex instead of grep.
  • Build system: turn off PCH on bad ccache version.
  • Build system: Bash on Ubuntu on Windows -support.
  • Build system: work around MinGW 6.1.0 linking issue.
  • Build system: MinGW 6.1.0+ fix (narrowing conversion / internal compiler error.)
  • Build system: consider MinGW as multilib compiler.
  • Build system: make URHO3D_64BIT option applicable on MinGW.
  • Build system: use absolute output path for MinGW sysroot auto-detection.
  • Build system: fix Wayland build.
  • Build system: autodetect availability of clock_gettime() on Apple platforms.
  • Build system: fix package metadata for RPI & ARM platforms.
  • Build system: fix Urho3DAll.h generation in non out-of-source build.
  • Build system: avoid special chars in paths in MRI script passed to ar utility (Web build.)
  • Build system: Always use export header for auto-discovering build options.
  • Build system: use -O2 option for MinGW release build
  • Build system: add option to control how to share resources on web platform.
  • Build system: check availability of native compiler toolchain.
  • Build system: remove older CMake constructs that are no longer necessary.
  • Build system: new Android toolchain.
  • Build system: several Web build related improvements.
  • Build system: MODULE library type support option for Web build.
  • Build system: disable exception handling codegen for Web DEBUG build.
  • Build system: remove unused options from define_source_files() macro.
  • Build system: Prevent resource symlink creation during resource packaging.
  • Build system: Skip try_compile test when not appropriate (iOS debug build.)
  • Build system: use no_weak_imports linker flag.
  • Build system: workaround struct redefinition on newer MinGW.
  • Build system: search for DirectX path both rooted & non-rooted.
  • Build system: make clean for MinGW / Android / Web platforms.
  • Build system: enable multi-threaded compilation in Visual Studio.
  • Build system: fix mklink test when current path is not sources dir.
  • Build system: fix symlinked batch files not being launchable from Windows Explorer.
  • Build system: generate PCH files using naming convention expected by Clion.
  • Build system: generate dummy PCH only in out-of-source build tree.
  • Editor: do not attempt to parse extensionless files as XML.
  • Editor: draw navigation debug geometry.
  • Editor: prevent unnecessary attribute inspector refresh on resource reload.
  • Editor: allow drag-drop of generic XML files into attribute edit fields.
  • Editor: improved handling of structure attributes.
  • Editor: optimization to avoid updating temporary objects when they are not shown in hierarchy.
  • Editor: optimize update during object spawn.
  • Editor: paint selection.
  • Editor: show origins option.
  • Editor: fix UI element internal var indexing so that editing user-defined variables works right.
  • Editor: restore window positions on viewport mode switch.
  • Editor: terrain editor.
  • Editor: color wheel for Text3D.
  • Editor: double size on high DPI display.
  • Editor: fix resource browser node add/removal shown in hierarchy window.
  • Editor: fix resource browser preview camera position.
  • AssetImporter: possibility to export animation without skinned mesh.
  • AssetImporter: $fbx node suppression.
  • AssetImporter: fix animation start/end times when saving multiple animations.
  • AssetImporter: fix incorrect applying of model’s root node transform.
  • Documentation: explain how to setup Windows MKLINK privilege.
  • Documentation: add section on scene graph events.
  • Documentation: explain EMSCRIPTEN_WASM build option.
  • Documentation: note on simultaneous network server & client usage.
  • Documentation: update on the define_resource_dirs() macro.
  • Documentation: do not include RapidJSON classes.
  • Documentation: inverse kinematics page.
  • Sample content: Kachujin model, used in SkeletalAnimation sample.
  • Sample content: new Urho3D logo.
  • Sample content: mutant model added to the CharacterDemo.
  • Sample content: Vertex colors in the standard primitive models.
  • Sample content: fix normals / lighting on the cylinder.
  • Sample content: Line primitive models.
  • Sample content: material preview model.
  • Fix broken off-mesh movement for CrowdAgent.
  • Fix Bullet assert / crash when collision shape was changed from compound to non-compound.
  • Fix unintended update of wordwrapping text’s width.
  • Fix uninitialized fields in FontFaceBitmap.
  • Fix recreation of CollisionChain2D shape.
  • Fix positioning of borderless window (if not filling the whole monitor.)
  • Fix RigidBody2D not returning to original transform.
  • Fix copypaste error in SpriteSheet2D load code.
  • Fix out-of-bounds text buffer access when compiling an AngelScript module.
  • Fix VariantMap to JSONValue and back conversion.
  • Fix handling /./ in executable path in SanitateResourceName().
  • Fix crash if script object constructor throws.
  • Fix incorrect optimization in UIElement::GetElementAt().
  • Fix potential crash when erasing sibling nodes during component destructor.
  • Fix blend modes for 2D particles.
  • Fix use of asGetActiveContext() in template code, as it could leak undesirably to user application and cause undefined symbol.
  • Fix jumping Slider knob.
  • Fix AngelScript temp variable corruption and problem with handle-reference argument.
  • Fix Constraint2D body connection serialization (other body nodeID.)
  • Fix instancing in vegetation shader.
  • Fix SDL keyboard input on RPI platform.
  • Fix fixed size billboard not properly realculating size in all cases.
  • Fix multisample quality handling on D3D11.
  • Fix Text3D batches beyond the first not showing correctly.
  • Fix input scaling for high DPI displays.
  • Fix differentiation of alpha & RGBA textures in text shader.
  • Fix crash in usedGlyphs mode.
  • Fix zero sized UI root element causing divide by zero.
  • Fix various missing script API functions.
  • Fix terrain UV coordinates generation.
  • Fix shader define update when Text3D changes its rendering between SDF / non-SDF.
  • Fix erroneous fadeout of other AnimationController animations, if playback of new animation failed.
  • Fix nearest filter mode not using mipmaps on OpenGOL.
  • Fix skinning matrix pointers changing erroneously after late creation of bones.
  • Fix BillboardSet 16 bit indices limitation.
  • Fix CrowdAgents getting erroneously included in navmesh geometry.
  • Fix calculation of UI element combined screen rect.
  • Fix world space tangent for billboards.
  • Fix ValueAnimation’s time range not getting expanded by adding event frames.
  • Fix ValueAnimation removal during event handling causing crash.
  • Fix word wrap text char positions.
  • Fix WorkQueue item insertion; insert last if no other option possible.
  • Fix unnecessary mouse centering in screen mode change handling.
  • Fix unsafe removal of event receivers.
  • Fix string corruption in SQLite queries.
  • Fix error in skybox HLSL shader when instancing is forced on.
  • Fix erroneous reuse of backbuffer depth buffer when multisampling.
  • Fix uninitialized memory in Material.
  • Fix out of bounds array access when material quality is higher than high.
  • Fix shadow-related shader function signatures on GLES.
  • Fix shaky water shader on GLES.
  • Fix memory leak in AngelScript Dictionary.
  • Fix weight fade erroneously affecting animation after weight was set manually.
  • Fix LookAt mixed rotation mode.
  • Fix skydome GLSL shader.
  • Fix depth bias not getting cloned in Material::Clone().
  • Fix CrowdAgent removal to be safe during reposition event.
  • Fix keeping track of RigidBody2D constraints.
  • Fix double shader parameters passed from e.g. Lua, convert to float.
  • Fix navigation system obstacles not observing their scene node movement and updating themselves.
  • Fix self-insertion in Vector.
  • Fix slowed down navigation agent when scene node dirtied during reposition event.
  • Fix slope-scale bias adjustment on OpenGL.
  • Fix incorrect hashing of rasterizer states on D3D11.
  • Fix AnimationController animation search differentiating slash and backslash when it shouldn’t.
  • Fix LineEdit text & cursor not being centered by default.
  • Fix potential flipped normals in physics collisions (double manifold issue.)
  • Fix undefined __cpu_model symbol in shared lib on GCC.
  • Fix cache datatype for URHO3D_LIB_TYPE
  • Fix Android black screenshot (use RGBA format.)
  • Fix missing network update if node is added to the scene late.
  • Fix crash when setting model resource to drawable component that is not attached to a scene node.

August 19, 2017 12:00 AM

August 16, 2017

Cocos2d-x

Cocos Creator v1.6.0 released!

Cocos Creator v1.6 release is here! Thanks to the community for the patience of this version’s long test cycle and the positive trial and feedback on the beta versions. We continue to improve performance, efficiency and user experience in this

by Virginia Hong at August 16, 2017 02:14 AM

August 15, 2017

OGStudio

Scripting research

Scripting research
This article describes scripting research in July 2017.

Our first goal of using a scripting language was to have a platform-independent code that runs unchanged on every supported platform.

OGS Editor 0.10 supports Python for such a code thanks to SWIG. SWIG provides a way to wrap almost any C/C++ code and use it in dozens of languages like Python, Ruby, Lua, Java, C#, etc.. SWIG really helped us taste the beauty of platform-independent code. However, SWIG only works one way: from C/C++ to a target language. This means the main application must be in the target language, and C/C++ code can only be used as a library.

Having the main application in Python works fine for the desktop, but not so great for mobile and web, where C and C++ are the only natively supported cross-platform languages. There are projects like Kivy, which allow you to develop cross-platform applications in Python, but they are not supported natively. This means it’s a lot of headaches when Android and iOS APIs change.

Having the main application in C/C++ and the need to support scripting means that a scripting language should be interpreted by the application. This is what SWIG, Kivy, and similar projects are not meant to fulfill.

Our secondary goal for using a scripting language was to allow to extend C++ code.

OGS Editor 0.10 has some modules written in C++, and some in Python. The modules are equal from the perspective of the main application; it doesn’t care what language the module is written in.

To achieve such flexibility, we introduced a so-called Environment. Each module would register the keys it responds to, and Environment would deliver corresponding messages.
Technically such behaviour is achieved by inheriting a base class and overriding its methods in both C++ and a scripting language.

First, we evaluated Python for the role of cross-platform scripting language.

Since we already used Python, we started to research the possibility to run Python code on every supported platform. The result was disappointing because CPython (the default Python implementation used on the desktop) does not mention mobile and web platforms. We only found some years old forks of CPython that were claimed to work either on Android or iOS. Such a disarray was not suitable for us.
We also had a look at PyPy, another Python implementation. It also did not mention support for mobile and web platforms.

This was a clear indication that Python community doesn’t care for mobile and web platforms. Or that nobody had time to provide the information about building Python on such platforms. Either way, it was not acceptable for us.

Second, we evaluated Wren for the role of cross-platform scripting language.

Wren was the first scripting language we stumbled upon in the long list of non-mainstream scripting languages.

Wren claimed to be small and easy to learn. Wren also claimed to be intended for embedding in applications. Ironically, the author had no time to document how to do the embedding in the first place. When we asked for the time estimates of publishing the critical part of the documentation, we just got a reference to another issue where the other guy was asking the same question half a year ago!

That’s when we ended our relationship with Wren.

Third, we evaluated Chai for the role of cross-platform scripting language.

Chai was in the long list of non-mainstream scripting languages, too. Chai was promising because it claimed to be specifically tailored for embedding in a C++ application.
We successfully managed to call a C++ function from inside Chai but failed to call a member function. We asked for help, but nobody replied.

We had to end our relationship with Chai.

Fourth, we evaluated Lua for the role of cross-platform scripting language.

Lua is the mainstream language for embedding. So we decided to try the obvious choice. Documentation looked promising, too. However, by the end of reading the C API chapter we had no clue how to inherit a class inside Lua.

This led us to search for libraries that wrap Lua C API syntax into something more meaningful for C++. That’s how we found Sol2. Just as before, the first attempt to call a C++ member function from Lua failed. But unlike before, we asked for help and got the help! This was a refreshing surprise for us.
Next, we tried to inherit a class in Lua and override the class methods. We failed, but the author helped us out again. In the end, we succeeded in inheriting a class and overriding its behaviour.

That’s when we understood it’s a start for a long and mutual relationship with Sol2/Lua.

This search for a scripting language taught us one important lesson: people matter, not technologies.

There are lots of scripting languages that look shiny on the outside but are dead. Why? Because some authors don’t have time for users. In return, users don’t have time for the authors’ projects.

That’s it for describing scripting research in July 2017.

by kornerr at August 15, 2017 08:06 PM

August 14, 2017

Castle Game Engine

Delphi base compatibility, Spine improvements, other stuff :)

  1. Intensive work on the engine Delphi compatibility is ongoing 🙂

    We can now actually compile and run in Delphi (10.2) a simple console demo using our “base” units. Vectors, matrices, colors, rectangles, time measuring, logging, a lot of string and class and other utilities… it’s all working in Delphi. This is the demo code.

    In parallel, I’m fixing the syntax of all the code to compile in “FPC Delphi test mode”, this is providing a nice baseline to later compile in the actual Delphi. On this front, I almost finished porting everything non-visual (I’m finishing the X3DNodes unit, which is a huge unit that depends on almost everything non-visual in the engine). So, we’re close 🙂

    The “FPC Delphi test mode” means that we use FPC, but in Delphi mode, and disable macros, and disable operators like += etc. And I can run on Linux too, which is comfortable for me 🙂 So it’s like “make FPC behave as much as Delphi”. Any changes required at this stage would be required by Delphi too. To use it, you can set environment variable CASTLE_ENGINE_TEST_DELPHI_MODE to “true” before running the build tool.

  2. Units cleanup was done along the way. I rearranged some units, to remove some uncomfortable dependencies (when too many units are inter-dependent on each other). In effect, we now have a “files” unit group that includes units from old group “net” + units dealing with files. More details in the units map in the wiki.

  3. Spine (2D animations format) improvements:

    1. When animating in Spine using Bezier curves (translations or rotations), the resulting movement in our engine is now exactly what you see in Spine.
    2. Animating the scale in Spine is now fixed (it was accidentally changing the order of layers).
  4. DDS (image file format) improvements: support reading DX10 + DXGI_FORMAT_R8G8B8A8_UNORM case (produced e.g. by PowerVR Texture Tools when converting RGBA image to DDS).

  5. In a spur of the moment, I wrote a short page about “What are range and overflow checks (and errors) in Pascal” 🙂

  6. TDebug3D class is a new simple approach to visualize debug things attached to 3D objects.

by michalis at August 14, 2017 02:56 AM