Jump to content
    1. Today
    2. Thank you all very much for your replies, they were really helpful. I will go ahead and try two ideas you guys proposed here: one is – given a prototype – allowing each component to initialize itself and the other one is having a map of component factories. At first sight, the first option seems to be easier and more straight forward than the later but at the expense of having "prototype instantiation" code all across my components, something the second option seems to avoid. I will follow up with you guys as soon as I have something solid. Thanks again!
    3. Fidel Surtida

      Hammer Blocks

      Different kinds of Hammers and Blocks combined together to give you a unique puzzle game. Your one and only goal is to destroy and obliterate all Blocks that can be seen. You will be given a fixed set of Hammers each Level and you have to use each of the Hammers wisely and figure a way to destroy all Blocks in sequence.◆ Hammer and Block Stats ◆Each Hammer and Block has their own characteristic and stats in the game. A Hammer has its own damage and rules that define what Blocks they can destroy. A Block contains a specific health that determines how tough they are.◆ Hammerpedia and Blockpedia ◆These books will guide and give you knowledge to the world of Hammer Blocks. It gives you full details and stats of all Hammers and Blocks. It also gives you a way to track how many blocks and hammers you've unlocked. ◆ Chapter based Levels ◆Each chapter has a theme of different set of hammers and blocks. Every chapter contains different gameplay but with the same concept of destroying all blocks in a level. Watch out for updates as this game will continue to add and populate different kinds of hammers and blocks that will never get you bored.◆ Time Rush Levels ◆Not all levels require thinking to be beaten. These levels are no brainers but will require you to have skill and dexterity in order to beat them. If you want to just smash and break all day or just take a break from the puzzle levels then this is just the game that you're looking for.◆ Rankings ◆Speed Breaking Challenge is a way of showing your dexterity and skill to finish quickly a level. The rule is you need to perfectly finish a level in 3 stars as fast as you can. One false move and you're out! This is a Weekly Leaderboard Challenge that will be set on 3 different levels. Challenge other players and rise to the Top of the fastest speed breakers of the game.
    4. Hi everyone! I need to transform a 32bit PFM (HDR) file, reading pixel by pixel, into a usual LDR format and later write into PPM and BMP files. Can someone please give me an equation to solve this or a sinppet. is it enough to tonemap?
    5. You could also pass all the json data onto each component generation system and let it parse out it's data itself if you want to go very simple. So every component system gets the json data and scans it for any related components it handles. Wastes a little processing time but super simple to implement too.
    6. I've been looking more into PIDs, however I'm not sure where to start learning how PIDs are combined in automation. For example, we have both the turning mechanism as well as the acceleration - both affecting how we arrive at our goal but independent on each other. I can implement some logic which attenuates the acceleration by the difference between the heading and the target angle, but I wouldn't know how to extrapolate this if more actuators were involved. I'm sure this is an existing problem, however I don't know what the field is called or what to look for.
    7. I have a texture I'm reading from like this: vec4 diffuseFrag = texture2D(DiffuseMap, fDiffuseCoord); Sometimes, for special effects, I'd actually like to do something this: vec4 uvFrag = texture2D(UVMap, fUVCoord); vec4 diffuseFrag = texture2D(DiffuseMap, uvFrag.rg); ...basically, I'm using a texture's Red and Green color channels to store the frag coordinates I want to read from DiffuseMap. My probably is, both the UV map and the Diffuse map are spritesheets with multiple images in them. This means, I'm actually wanting uvFrag.rg's (0-1) texcoord to be multiplied against the *subportion* of the texture that all four vertices of my fDiffuseCoord are referring to. Something like: vec4 uvFrag = texture2D(UVMap, fUVCoord).rg; vec4 upperLeftOfSubrect = ...; vec4 bottomRightOfSubrect = ...; vec4 subrectSize = (bottomRightOfSubrect - upperLeftOfSubrect); uvFrag = upperLeftOfSubrect + (uvFrag * range); vec4 diffuseFrag = texture2D(DiffuseMap, uvFrag.rg); Where my mind is going blank is, how can I get upperLeftOfSubrect / bottomRightOfSubrect, without bloating my vertex struct further with additional attributes? It mentally trips me up that I'll have to copy upperLeftOfSubrect / bottomRightOfSubrect into all four of my vertices... and triply annoys me because I'm already passing them in as fDiffuseCoord (just spread between different vertices). Is there a simple solution to this that I'm missing?
    8. sevenfold1

      MorphTarget: Delta Normal / TangentZ ??

      I would think so. That's what 'delta' usually means in mathematics.
    9. You could start with a basic implementation where component factories are registered by name in a map. When creating your entities, iterate over the "components" object and use the key to look up the factory in the map. Then pass the corresponding value to that factory so it can instantiate the component with the proper data. As there's nothing with this approach specific to components or entities, it can be reused and extended to support just about any structured, nested data model. This technique is commonly used in serialization libraries, where you frequently need to reconstruct runtime data from information received over the network, or some other external source.
    10. Wow, this looks fantastic. I used to play Snowboard Kids on N64 a lot, and until I saw this, I didn't realize how much I missed cartoony snowboard racing games!
    11. RPTD

      Ideal rendering engine?

      Thumbs up for somebody not wanting the broken metalness concept (meaning, going against the original idea of using PBR).
    12. Building a team for the development of strategic and operational war games. Any good vision requires the sight to see beyond what's in front of you. Whether you're a fan of the genre, or just looking to fill out that resume a little, this could be the project for you. So, why volunteer your time to this project over any other? Firstly, the vision is robust in guiding the approach to developing the game. As I am the dedicated game designer, you will not be asked to research and design parts of the game, allowing you to focus on your skill-sets. The current GDD is over 20 pages, while that in itself is not an accomplishment, it goes to show that thought and even some refinement has gone into the project already. Secondly, there is a working plan beyond just the game's development. Groundwork is being laid for future marketing, crowdsourcing campaigns and a commercial business model. With business experience in my background already, my approach here is based on a solid foundation. Thirdly, I value your time as I do my own. Volunteer however many hours a week you want. While the positions are unpaid at present, I am looking at kickbacks after a successful crowdsourcing campaign, in addition to the profit-share options. The short-term plan is to develop the game as much as possible over the next three months, splice together a demo video and launch a crowdsourcing campaign. If you're able to commit for three months, by the end we will have a better picture of the game's viability. After which, you can assess for yourself whether to continue with the project or move on. Current progress, while still bare-bones, has two programmers onboard in a part-time capacity coding various mechanics. I myself am here in a full-time capacity. We are looking for a host of skill-sets, from C# programming to 2D designers, UI, AI and multiplayer networking. Take some time to consider, and feel free to explore this more. I am more than happy to sit and discuss the project, and answer any questions you have. Thank you for your time J Johnson
    13. LarsEnt

      Tito Returns

      The Marshall is back! Ready to liberate the Republics and take up the fight against the Evil Spirits of the past in seven shoot n' run, beat 'em up, action platformer and railroad shooter levels. The game is ads and microtransactions free.
    14. Frantic PonE

      Ideal rendering engine?

      Opposite opinion, sort of, from Hodgman. Vulkan is more compatible (Windows 7!) has some more useful features, and is even ever so slightly faster than DX12. Also, Deferred Texturing is nice, if you want to not bother with metalness. You can do whatever you want with materials then, as good as a forward pipeline, along with other neat features. IE no sitting there and writing half of the deferred features in for Forward anyway just because you want SSAO or etc. Ideally? Ideally I'd write a ratyrace only, non polyogonal modelling only (Voxels? Subdivision? Combination of?) engine with GPGPU physics only (it works for Claybook... SDFs for the win!), among other things. I'd ditch normal UV mapping for Volume UV mapping only, maybe figure out how to do volume particles only. Particles today are so horrid, even when running a ton of Raytracing on assumedly a $1k 2080ti, with fancy lighting and reflections, they just look like terrible, 2 dimensional, unlit junk. Just compare that to Tintin (2011), which primarily used Raster (old Renderman) and had secondary single bounce GI occlusion of such a low res you could see aliasing artifacts, yet in the plane crash scene the sand is so much better than anything in games today.
    15. Yesterday
    16. sevenfold1

      PBR rendering engines?

      I'm looking for a open source PBR rendering engine that I can use. Basic requirements are Windows (C/C++) and free to use type license. The first two hits I get on Google are: Filament https://github.com/google/filament/ LuxCoreRender https://luxcorerender.org/ Does anybody have any experience using any of these, or do you recommend something else that's better? Thanks.
    17. Hi, thanks for the reply. There is a third party app that is interested in a project I have completed. They want to try to incorporate the game into their app, I can certainly utilize .dll's and even create an SDK if the game engine allowed it. I currently use Unity3D which doesn't support this (there are hacks but I would rather not hack it). Hopefully that clears it up a bit. Thanks again, Rob
    18. fleabay

      Using a game engine as a library

      Does the existing app have an SDK or allow plugins? Can you say what the app is? If you are saying the existing app is something you can compile, most languages allow you to issue system calls to start programs.
    19. With the LGPL you can ship a DLL of the library instead of static linking to avoid sharing your code. This is expected practice and not a work-around. Even if you don't use the LGPL part of FreeImage and wanted to static link, I would go so far as to try and remove all LGPL code completely and build the static library before using it. There may be a preconfigured make option. Don't even touch GPL code without planning to release the source code to your game. DLL or not.
    20. Greetings, I have a specific need to launch a game from an existing app. Has anyone come across a game engine that can be built in this way? Any help would be appreciated. Thank you! Robert
    21. Thank you for the time-saver concerning the VAO, Josheir
    22. For me, my entity is just an ID and a bitset of each component(s) it has, set to 1. When I create an entity from data I pass it to the factory class. Each component system (that does work on the component(s), creates, updates, destroys, etc) registers itself with the factory. I pass the data on to the general factory which parses the data and passes on the requested data to each component system to initialize that component with. I'm a C/C++ programmer so no idea what Java's reflection system does but you should be able to implement something similar to what I described quite easily. Especially with text (json) data. <rant>Though I hate json/xml and just create my own format. No need for a bloated library of features I will never use and took me about an hour to code up and test/verify</rant>.
    23. Hi all, I'm currently working as the sole writer on a project involving around ten people, although I've slipped into more of a design role as required. I'm responsible for mapping out the critical path through the game, which looks like it may become a more involved process later unless we get a level designer on board. My problem is that all our disciplines have essentially started at the same time, with the project being the metaphorical equivalent of a blank slate. This means that some of the processes that would usually be downstream (music, art etc.) have started at the same time or even with a couple of weeks' head start. I'm conscious of not causing too many reworks in other departments at the same time as not becoming constrained by finished work that never got a chance to be run past the narrative. Can anyone recommend a good order to tackles things in? I'm pretty new to this — at the moment I've prioritised the critical path for the first section of the game followed by a vertical-slice 'story MVP', but I'm worried I may be missing more important first steps (all the story doc is missing is some societal notes and a couple of character detail sections [four are already covered]). I'd be grateful for any process suggestions that would work in this scenario — at the moment I'm operating a(n infrequently used) feature and story board on Trello to keep things ordered.
    24. Instead of one big ugly image, this time I'll give you lots of smaller ugly ones. I added a new main branch to the old Mind Map, this one describes how the actual servers will be configured. This is a general overview of course, I'm building for a single (Physical/Virtual) server installation first then I'll add in data replication and failover capabilities later. A new server type was added as well, the Social Server, it does some fairly obvious types of things.. After looking at the big picture and, well spending some time painting it first, I started to see some ways to optimize and organize things better. For example I've completely moved the main "Player Attitude Network Relay" or Position/Attitude Reflector (the thing that makes network player character coordinates propagate to other player clients on the internet..blah!). It was going to just live in the Avatar Server, but that handles Authentication and quite a few other very crucial game play roles.. So now it lives where it makes way more sense, at the point in the system where its data is needed the most. In the Action Server, this server handles all of the fast action related decision making. The Avatar Server still handles propagating the player character's Data(features, wardrobe,etc), just not the deluge of player movement data. This makes it far easier to design this part of the system to scale, which is important because this is one of the critical points for concerns of scale. As long as EVERY Action Server maintains accurate positional buffers, then it doesn't matter WHICH Action Server processes the client's messages. Keeping the positional buffers in sync will probably require the addition of high speed intermediary "Data Base" Servers and all that jazz. I ramble, but I'm making some good progress towards a cohesive plan, and it's making everything start to feel like it's coming together. The hacknplan data entry is still much in progress, I've started adding tasks to keep myself on track with adding data to it.. haha, sounds redundant but it's helping me stay on track. Here's the Game Design Model I was talking about in my last thread, I'm enjoying the simplicity of it all. It's essentially just the tree structured view of my Mind Map, so it's pretty easy to keep these two tools in sync. I add child items where necessary and attach tasks to whatever branch/child I want. The main "Board" view is just a standard KanBan style system, but it's simple and easy to work with, it integrates well with the Game Design Model and seems to be fairly stable. Here I'll attach the whole of the latest Mind Map revision, for the curious and/or gluttons of punishment. I'm happy with my progress so far. Slowly approaching the Maintenance point. Then the full code sprint starts again. I'm still coding, so I don't lose my place, just not at the pace I would like with all the admin work I've given myself. Anyhow, enough talking about stuff I've already done, I've got stuff to do!
    25. Thanks Rutin, I think it's better to be safe than sorry.
    26. jb-dev

      Vaporwave Roguelite

    27. You need to read all of the licences for each library you intend on using. When people "package" a lot of libraries under one roof the license for the package itself doesn't over-throw the individual licences for the libraries included. Find out each library you're using within the package, and go to their original distribution site, you'll find the licence information there. http://freeimage.sourceforge.net/license.html For example LibRaw: https://www.libraw.org/docs they list: LibRaw is distributed for free under two different licenses: GNU Lesser General Public License, version 2.1 COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0 You'll have to do your own due diligence as any mistake will affect you more than any member here.
    28. I am planning to use some third party libraries, more specifically FreeImage, and in the Download page there is a Disclaimer: http://freeimage.sourceforge.net/download.html Basically it displays the licenses and the copyright owners of the libraries included within FreeImage. I know I have to display FreeImage's license at some point in my game, but do I have to display all of those licenses from the libraries contained within FreeImage itself?
    29. Yes, sure. Not all pixel programs are equal. You definitely want to select one that has all the features you want to have. You can't make a wrong choice. Editors and other programs are personal choices, for you and only you the choice has to be optimal. What all others think about your choice is irrelevant. Everybody use the programs he/she likes best, and recommends them. However, there are no two people that make the exact same choices. As such, asking around gives you a list of software that people use, but pretty much always there is no single program that does everything optimal for everybody. You have to make your own selection of programs that work best for you. You usually do that by giving them a spin (or two), and keeping what you like. Your choices do vary over time, so it's quite likely that what you pick today will be discarded tomorrow, and that's fine. You evolve (in experience and interests), software evolves (in features), and computers evolve (in hardware, as well as software). It would be weird if you never change preferred programs in your life.
    30. Hi there ! Do you want to learn how to create your own sound design for your games ? Here is how you can very easily make some bow and arrow sounds for your RPGs or adventure games !
    31. Corona Labs is pleased to announce that the Steamworks plugin is now open-source. The Steamworks plugin is used by PC and macOS games published to Valve’s Steam service that allows support for leaderboards, achievements, user profile data, and microtransaction support. Now you can download the repository for the plugin and add your own features and extensions to it. You will have to have a Steam developer account to be able to test the plugin. Follow Steamworks documentation (available on Steam’s developer portal) to learn how to enable Steamworks debugging and development for your game. You can get the plugin source at our GitHub repository. You can learn more about the Steamworks plugin in our previous announcement. View the full article
    32. Ahrakeen

      C# Programmer seeking Project

      If looking for a project i am working on a tactical roleplaying game. Something akin to disgaea or fire emblem. with a 2.5d graphics If interested in more information let me know
    33. I have a stereo 3d application that needs a scene - depth 3d cursor. I found one single post talking about this while googling - from the year 2000 - about having a sphere represent the cursor. This sphere would slide along the objects of the scene according to their depth, getting the depth buffer from at the 2D cursor mouse pos then unprojecting to get position from depth. Then, he said he made that 3d pos be the center of the sphere. This is my function for reconstructing pos from depth in the FRAG shader....I just dont know how to do it in the VERTEX shader so that the sphere actually moves to the location. Any help? I am using a deferred renderer, Maybe his solution works only with forward rendering? vec3 reconstructP(vec2 UV) { vec4 vProjectedPos = vec4(1.f); vProjectedPos.rg = UV * 2.f - 1.f; vProjectedPos.b = texture(gBuf_DS, UV).r * 2.f - 1.f; vec4 vPositionVS = scene.PMinv * vProjectedPos; return vPositionVS.rgb / vPositionVS.a; } vec3 P_VS = reconstructP(v.uv);
    34. Zipster

      Symbol lookup error on Linux

      CMake is more than capable of handling the build configuration you describe, provided that the target dependencies have been correctly declared. The two most likely causes of your issue are 1) libLinearMath.a isn't being linked in (however this would probably result in a lot of other unresolved symbols), or 2) libLinearMath.a is being linked in before whichever object uses the symbol. Either way, it points to a fixable configuration problem. Is the code that calls CProfileManager::Reset() inside a translation unit that's linked directly into the shared library, or is it in another static library (or perhaps shared library)? How have you configured your target dependencies (i.e. [TARGET_]LINK_LIBRARIES)? Also next time you build, use "make VERBOSE=1" for it to echo all the commands it executes so you can observe the link line it generates.
    35. I've hit a similar issue in my game, it's a puzzle solver where visibility of the whole puzzle is useful and the level designer has assumed that it's a 1920x1080 screen with 64x64 blocks. For the other resolutions, typically lower spec PCs, the choices as mentioned above: 1. Draw to an off-screen texture at 1920x1080 resolution and then scale on screen (maybe with the text overlays rendered at the native resolution for simplicity) 2. Draw directly to the scaled ratio The advantage of #1 is that it's the simplest (I do this for my UWP version so users can resize the window without killing my puzzle aspect). The disadvantage is that you're burning compute cycles to do so. Whether this is important depends on the rest of the load on your GPU. For me, it appears to be irrelevant though. #2 allows a much greater flexibility, but does require greater resources (i.e. those for 32x32, those for 64x64 etc.) Along with probably slightly more complicated rendering logic. Reading your post more though, you talk about a strategy game - and hence I'm assuming that being able to see as much of the battle field as you like is important. I'd almost argue that users would expect to be able to zoom in / out regardless of screen resolution, so I'd be inclined to go for option #2. You could do as @Zakwayda points out and use standard mip-maps and if you're allowing zooming to be done dynamically, I'd go down this route. Otherwise, you could do this in the resource generation stage of your pipeline, so you only ever load in a single resource set rather than loading multiple and subsequently deciding which texture set to use per frame. Also, for the aspect ratio, for my game (puzzle in a space station), if a user resizes to a weird ratio, I just add black bars on the appropriate side. Again, for a strategy game, I'd be inclined to let them play with whatever ratio they have.
    36. Agree Alberth, but I do feel that there are some softwares which makes your life easier as it has the grids and is easy to paint for certain bit size characters. But I could be wrong, so feel free to correct me if I am.
    37. Greedy Goblin

      Making Decisions In Text Adventures!

      If you're aim is more to write a text adventure and you're not so bothered about doing it in C# then I'd suggest looking at inform7.com as it enables creating interactive fiction in plain English (or close enough). I've used it myself and its actually pretty neat. You can even embed your IF in a Web page quite easily if you want.
    38. GuyWithBeard

      Symbol lookup error on Linux

      Allright, I actually got it working, but I am not sure why it didn't work yet. So, I had a look at the problematic call, and as I suspected it was surrounded by #ifdefs (usually profiling code like this can be compiled out). #ifndef BT_NO_PROFILE CProfileManager::Reset(); #endif //BT_NO_PROFILE All I did was make sure BT_NO_PROFILE was defined when compiling both the plugin library and bullet itself. Not sure why I would have to do this though, as I have used the exact same way of building everything on OSX and Windows. But it works and that's the most important thing.
    39. You're correct that aspect ratio can be an issue regardless of what approach you take. Aspect ratio and window resolution are to a certain extent orthogonal issues. As you said, using a fixed aspect ratio for the game content could result in stretching/distortion, which I think would be undesirable under most circumstances. So even with the downsampling approach you mentioned, you'd still need a way to handle that. With your e.g. 4kx4k approach, the simplest option might be to clip off the sides or top/bottom of the rendered image as appropriate based on the window aspect ratio (since you're already ok with showing less of the world under certain circumstances, it seems like this would be acceptable). Is there any particular reason you think the quality is or would be poor when downsampling from e.g. 1920x1080 to 1360x768, as you mentioned? I'm not questioning it - I'm just curious as to whether you've tried it, and if so, what sort of negative effects you're seeing. Maybe the downsampling approach is desirable for reasons I'm not thinking of, but it seems like it could have some cost in terms of texture memory and rendering effort. An alternative would be to use art appropriate for the largest resolution you want to target, and then render directly to the selected resolution while letting mipmaps handle the downscaling. That could still result in a lot of wasted texture memory though. A further refinement would be to load art based on the selected resolution (similar to how platforms like iOS and Android provide ways of selecting differently-sized images based on screen size). Also, you may already have thought about this, but showing less of the world on lower resolutions isn't the only option. You could just allow everything to scale with the resolution instead (although as mentioned before you'd still have to deal with differences in aspect ratio).
    40. EddieK

      Warfront Infinite

    41. WitchLord

      Problem with value type & opAssign

      Your opAssign methods are declared as 'const'. This is why the compiler is not able to use them for assignment. If your vec3 class doesn't really have any pointers or anything else that needs special treatment (which I presume is the case) you may want to register the class as asOBJ_POD which would allow you to skip the registration of the destructor. This should also allow the compiler to do a bitwise copy of the vec3 rather than having to call the opAssign or copy constructor. If you prefer not to use asOBJ_POD for some reason, you may want to register the copy constructor instead, as it would be more efficient when creating temporary copies of a vec3 value than first creating an instance then calling opAssign.
    42. Extendable prototypes are useful - Enemy->Undead->Skeleton for example. Just to not have to write so much. Using combining prototypes may be useful, but also kind of doubles the whole component thing - might well be superfluous. Creating entities from prototypes does not mandate passing parameters to whatever actually creates them. At whatever point you create an entity, you know why and what entity is to be created. You might as well just return one from the factory without passing anything other than the proto-id, and set whatever you need on the returned entity in whatever place requested it. Lets say you populate a dungeon with enemies - that generator-thing knows "right now i wanna place a skelly at X,Y" - so have it request a skeleton and have it set the proper position. If you have serialization for your entities, human readable that is (so you can manually adjust the file), you could just use that for "prototypes". create an "empty" skeleton, save it, and use that when somebody request a fresh skeleton. Another way might be to have prototypes and init-data, prototypes have an init-function that accepts init-data to set up that specific type of entity. So you can decouple specific inits away from the factory to some place more appropriate.
    43. Michael Bell

      How to Create a Mobile Game on the Cheap

      Liked your view, so good and interesting useful information 😁 Thanks a lot!
    44. This week my artist finished working on the new alien type called Fast Alien. After he finished, I spend some time incorporating it into the game, which means that I did some coding and managing animations. After I finished with this new alien, I started implementing the new GUI system. As of now I have finished settings and main menu screens. This is how it looks now: I also started preparing for the release of the game. I signed up for steam direct, sent them my documents, payed the registration fee, got my documents approved and next week I will start populating the steam store page.
    45. Normally I do sympathise with the adage of 'make games, not engines'. However text adventures are a special case, where imo it is actually EASIER to make as a generic data driven 'engine', rather than a bunch of game specific code.
    46. Right that makes sense, i'll definitely work on that. I appreciate all the help! That's fair, by text adventure i meant bare bones console describing the environment to you, typing for where you want to go and what you want to do. I understand i didn't make that clear. I appreciate the point of view. Just hearing the word 'engine' makes me feel a bit out of my depth, haven't even finished many full programs especially on the scale i plan with this one. But i will have to give that ashot as it is the most recommended option here and it seems beneficial to learn it now. Thanks for the help! (Yeah don't really know XML i'm barely scraping the surface of c# lol)
    47. Bregma

      Symbol lookup error on Linux

      Try playing with adding -Wl,--whole-archive to the LDFLAGS when building the bullet DSO. You're only doing partial linking when you're building your plugin, and the linker doesn't see the static object being used outside the library so it gets left behind in the static library. You need to tell the linker to put all of what's in the archive into the dynamic library. Creating shared libraries from static archives is tricky, that's why most build tools are a little goofy when dealing with that.
    48. Esteban5XG

      First time writer here.

      It reminds me of Monkey Island, for example. My advice is to play games like that for a while. They will bring you a lot of ideas to work on it.
    49. Hi, I try to wrap my head around operator behaviour, documentation does not say much for the C++ side, so I guess it should be probably simple but I can't get this to work: # this works vec3 a(1.0f); vec3 b(0.0f); vec3 c = a - b; # this doesn't Transform@ transform = Transform(); vec3 a(1.0f); vec3 c = a - transform.position; (70): No appropriate opAssign method found in 'vec3' for value assignment (70): Previous error occurred while attempting to create a temporary copy of object Transform register: asCHECK(engine->RegisterObjectType("Transform", 0, asOBJ_REF)); asCHECK(engine->RegisterObjectBehaviour("Transform", asBEHAVE_FACTORY, "Transform@ f()", asMETHOD(SpatialWorld, makeTransform), asCALL_THISCALL_ASGLOBAL, this)); asCHECK(engine->RegisterObjectBehaviour("Transform", asBEHAVE_ADDREF, "void f()", asMETHOD(TransformScriptProxy, addRef), asCALL_THISCALL)); asCHECK(engine->RegisterObjectBehaviour("Transform", asBEHAVE_RELEASE, "void f()", asMETHOD(TransformScriptProxy, release), asCALL_THISCALL)); asCHECK(engine->RegisterObjectMethod("Transform", "vec3 get_forward() const", asMETHOD(TransformScriptProxy, getForward), asCALL_THISCALL)); asCHECK(engine->RegisterObjectMethod("Transform", "vec3 get_position() const", asMETHOD(TransformScriptProxy, getPosition), asCALL_THISCALL)); asCHECK(engine->RegisterObjectMethod("Transform", "void set_position(const vec3 &in)", asMETHOD(TransformScriptProxy, setPosition), asCALL_THISCALL)); vec3 register: // Type & behaviours asCHECK(m_engine->RegisterObjectType("vec3", sizeof(glm::vec3), asOBJ_VALUE | asGetTypeTraits<glm::vec3>())); asCHECK(m_engine->RegisterObjectBehaviour("vec3", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(vec3_ConstructorEmpty), asCALL_CDECL_OBJLAST)); asCHECK(m_engine->RegisterObjectBehaviour("vec3", asBEHAVE_CONSTRUCT, "void f(float, float, float)", asFUNCTION(vec3_Constructor), asCALL_CDECL_OBJFIRST)); asCHECK(m_engine->RegisterObjectBehaviour("vec3", asBEHAVE_CONSTRUCT, "void f(float)", asFUNCTION(vec3_ConstructorScalar), asCALL_CDECL_OBJFIRST)); asCHECK(m_engine->RegisterObjectBehaviour("vec3", asBEHAVE_DESTRUCT, "void f()", asFUNCTION(vec3_Destructor), asCALL_CDECL_OBJFIRST)); // Properties asCHECK(m_engine->RegisterObjectProperty("vec3", "float x", asOFFSET(glm::vec3, x))); asCHECK(m_engine->RegisterObjectProperty("vec3", "float y", asOFFSET(glm::vec3, y))); asCHECK(m_engine->RegisterObjectProperty("vec3", "float z", asOFFSET(glm::vec3, z))); // Operators asCHECK(m_engine->RegisterObjectMethod("vec3", "vec3& opAddAssign(const vec3 &in) const", asMETHODPR(glm::vec3, operator+=, (const glm::vec3&), glm::vec3&), asCALL_THISCALL)); asCHECK(m_engine->RegisterObjectMethod("vec3", "vec3& opMulAssign(const vec3 &in) const", asMETHODPR(glm::vec3, operator*=, (const glm::vec3&), glm::vec3&), asCALL_THISCALL)); asCHECK(m_engine->RegisterObjectMethod("vec3", "vec3& opAssign(const vec3 &in) const", asMETHODPR(glm::vec3, operator=, (const glm::vec3&), glm::vec3&), asCALL_THISCALL)); asCHECK(m_engine->RegisterObjectMethod("vec3", "vec3 opAdd(const vec3 &in) const", asFUNCTIONPR(glm::operator+, (const glm::vec3&, const glm::vec3&), glm::vec3), asCALL_CDECL_OBJLAST)); asCHECK(m_engine->RegisterObjectMethod("vec3", "vec3 opSub(const vec3 &in) const", asFUNCTIONPR(glm::operator-, (const glm::vec3&, const glm::vec3&), glm::vec3), asCALL_CDECL_OBJLAST)); asCHECK(m_engine->RegisterObjectMethod("vec3", "vec3 opMul(const vec3 &in) const", asFUNCTIONPR(glm::operator*, (const glm::vec3&, const glm::vec3&), glm::vec3), asCALL_CDECL_OBJLAST)); asCHECK(m_engine->RegisterObjectMethod("vec3", "vec3 opMul_r(float) const", asFUNCTIONPR(glm::operator*, (float, const glm::vec3&), glm::vec3), asCALL_CDECL_OBJLAST)); asCHECK(m_engine->RegisterObjectMethod("vec3", "vec3 opDiv(const vec3 &in) const", asFUNCTIONPR(glm::operator/, (const glm::vec3&, const glm::vec3&), glm::vec3), asCALL_CDECL_OBJLAST)); // Methods asCHECK(m_engine->RegisterObjectMethod("vec3", "float length() const", asFUNCTIONPR(glm::length, (const glm::vec3&), float), asCALL_CDECL_OBJFIRST)); asCHECK(m_engine->RegisterObjectMethod("vec3", "float dot(const vec3& in) const", asFUNCTIONPR(glm::dot, (const glm::vec3&, const glm::vec3&), float), asCALL_CDECL_OBJFIRST)); asCHECK(m_engine->RegisterObjectMethod("vec3", "vec3 normalize() const", asFUNCTIONPR(glm::normalize, (const glm::vec3&), glm::vec3), asCALL_CDECL_OBJFIRST)); asCHECK(m_engine->RegisterObjectMethod("vec3", "string str()", asFUNCTIONPR(glm::to_string, (const glm::vec3&), std::string), asCALL_CDECL_OBJLAST)); Anyone knows what might be wrong here? Also if you spot some obvious inefficiencies please let me know - vec3 is small class (it's glm::vec3) that can be copied and used by value - maybe the problem is that I return a value from Transform::get_position() instead of reference? Or that I registered vec3::opAssign as returning reference, but without it I was having errors with registers and overall breakage...
    50. Find a normalized vector from your object to target. Find projection of its vector to coordinate planes of object's local coordinate system. Now calculate angles betwin of its projections and forward axe . Use a PIDs to turn on orientation trust proportionally to its angles (or ever proportionally to just a projections of target dir vector to other local axes for simplified but much faster approach). It will follow a target point ever in case target point is moving. Say more if you will use a differences of angles calculated on 2 consequtive steps as input of PIDs it will follow a interseption point for moving targets.
    51. Esteban5XG

      any tips for writing a good dark fantasy setting?

      What makes a character so special is all the lore behind it. And so with the enemies. It is my believe that giving the necessary relevance to these characters will make the story greater. Maybe in your case it could be interesting to find out why in this universe the enemies are "the enemies" indeed. Because it sounds amazing when the user does not recognize who is the bad guy in the story.
  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!