Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

-1 Poor

About elgun

  • Rank

Personal Information

  • Role
  • Interests

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi. I'm trying to integrate physics engine (Box2D) into my custom game engine based on entity-component-system. When I add physics component to entity, I also need to create appropriate objects in Box2D world. Because Box2D has it's own internal world data structure. But components in ECS are just only plain data, they don't have any behavior like OnAttached(), OnDetached(). Instead all the behaviors are implemented in systems. So I need to somehow know if component is newly added to entity or not in physics system. If it is newly added then create object in Box2D world. For that reason I created XXXCreateInfo components. (For example RigidbodyCreateInfo) And if I need to add rigidbody to entity, I just add RigidbodyCreateInfo with it's properties (mass etc..) to entity. And physics system create rigidbody in box2d world and attach it to entity with Rigidbody component and remove old RigidbodyCreateInfo. This method works good for adding physics component. But how can I remove them if entity is destroyed? Should ECS has OnAttach, OnDetach events for components? Or can we workaround this problem with only systems?
  2. Is there any simple language that can be both compiled and interpreted? Especially intended to scripting.
  3. There are VirtualProtect() in Windows, and mprotect() on linux for marking memory pages readonly. But I don't know is it possible to safely mark whole program readonly except dll's memory
  4. Hey folks! I'm planning to write game engine in the future with C++. For now, I'm just studying this area. But I came across problem with live coding in editor. Reopening the editor and loading all game assets at every time code changed is a big problem. There are some solution for this problem. For example: Using scripting language Compiling to .DLL and dynamically loading I wanted to choose first approach in the beginning. Even I successfully embedded 3 languages (lua, c#, js) into hello world c++ program. Each one have it's pros and cons. For example: Lua is very small (under 200kb) and very fast (with LuaJIT), but has less features. C# has lot's of features (generics, classes, lambas etc), but it's size is very large for mobile games. (~11MB with Mono-C# on android build) JS is simple and powerful language. But it's slow without JIT. For speed, you must use JIT based engines like V8. But iOS don't support JIT. I tried Duktape, but it's slow. But I wanted to give a chance to second approach. Because it's very fast and small. But C++ is a dangerous language. You can crash whole editor with small bug. And memory must be carefully managed. TLDR; My questions are: How can I hook into malloc of dynamically loaded library? With this way, I can free all memory allocated by dll before unloading it. How can I handle exceptions? Especially CPU signals, e.g.. division by zero, access violation (segfault). I tried Windows' Structured Exception Handlers but I failed. Is it possible to run dll inside virtual address space? With this way, programmer can't mistakenly alter editor's memory. Or don't give access to dll to write outside of it's space. This is something like checking range of pointer. Thanks.
  5. There are dozens of 3D graphics APIs. For example, OpenGL, Direct3D, GNM, LibGCM, OpenGLES, Vulkan, Mantle, Metal. And all of them are created for the same purpose: hardware accelerated rasterization. And all of them are using the same techniques (algorithms) for rasterization, there is no difference between them, except apis'. Why we humans reinventing the wheel? This makes cross platform game development very hard. Because you must learn all of them, and create abstraction layer on top of them. Even shading languages are different. You must create source-to-source transpiler for solving this problem. Sorry for the my bad english. I hope I expressed myself. Thanks.
  6. elgun

    Issues with D3D12CreateDevice

    Why you pass nullptr to last argument of D3D12CreateDevice?
  7. MSDN says CommandAllocator is used for storing GPU commands. But doesn't answer where it's stored. On the graphics card's VRAM or on the RAM. If it's stored on the CPU side, then every time we call execute, is it copied to graphics card? Or copied to GPU when we add new command to list and executed after? I think storing on the gpu side is better, because with this way we can cache commands and dont create every frame.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!