How to use dynamic resources with SharpDX by detail? I've looked through a lot of archives but still cannot figure out how it works. Taking this overridden one for example. public DataBox MapSubresource(Buffer resource, MapMode mode, MapFlags flags, out DataStream stream) Is this method aiming to change the resource with stream. If it is, why would the stream be marked out as if it is an output value rather than input? If the above one is true, where can I stream my data into the stream to update the buffer? Has it to be between the Map and Unmap methods? And typically how should I stream it (Take vertex buffer for example, what would the format of streaming be like?) Is it advisable to call the MapSubresource method whenever GPU access is finished(after every frame), and call the UnmapSubresource next frame to allow GPU access so it may save more time when I am keep updating the data? Thank you!


How do I change rasterizer state properly? To set the rasterizer state I have to ID3D11Device CreateRasterizerState() and then ID3D11DeviceContext RSSetState. And then I should ID3D11RasterizerState Release() it, right? How about when I want to change the state? Do I follow the above 3 steps again? When I want to change just 1 setting (i.e. only CullMode) do I still have to fill and set whole structure? Also, do I have to create and release the state object each time (assuming I don't want to set the exact same state again in the future)? How about performance? If I set the exact same state again does it do anything? Is there a difference between changing only 1 setting or most all of them?


Fbx SDK Importer issue (texture uv related) I am using the latest autodesk FBX Importer SDK, but whatever I do, I am unable to get the uvs right. Some parts are textured properly while others are not. I am using Direct3D9 and Direct3D11 (same result in both). Image 360 image https i.gyazo.com 5a2e5f6e127521915508c9c300eb03e5.mp4 The model uses a single texture and a single material shared among 4 meshes. Is there someone who sees immediately what the problem could be? Or is there someone who can replicate the issue for me and figure out what I am missing? FBX Test File http www.4shared.com rar o WG0Crpce Peach64FBX.html My UV reading method int vertexCounter 0 for (int j 0 j lt nbPolygons j ) for (int k 0 k lt 3 k ) int vertexIndex pFbxMesh gt GetPolygonVertex(j, k) Vector2 uv readUV(pFbxMesh, vertexIndex, pFbxMesh gt GetTextureUVIndex(j, k), uv) pVertices vertexIndex .uv.x uv.x pVertices vertexIndex .uv.y 1.0 uv.y vertexCounter void readUV(fbxsdk FbxMesh pFbxMesh, int vertexIndex, int uvIndex, Vector2 amp uv) fbxsdk FbxLayerElementUV pFbxLayerElementUV pFbxMesh gt GetLayer(0) gt GetUVs() if (pFbxLayerElementUV nullptr) return switch (pFbxLayerElementUV gt GetMappingMode()) case FbxLayerElementUV eByControlPoint switch (pFbxLayerElementUV gt GetReferenceMode()) case FbxLayerElementUV eDirect fbxsdk FbxVector2 fbxUv pFbxLayerElementUV gt GetDirectArray().GetAt(vertexIndex) uv.x fbxUv.mData 0 uv.y fbxUv.mData 1 break case FbxLayerElementUV eIndexToDirect int id pFbxLayerElementUV gt GetIndexArray().GetAt(vertexIndex) fbxsdk FbxVector2 fbxUv pFbxLayerElementUV gt GetDirectArray().GetAt(id) uv.x fbxUv.mData 0 uv.y fbxUv.mData 1 break break case FbxLayerElementUV eByPolygonVertex switch (pFbxLayerElementUV gt GetReferenceMode()) Always enters this part for the example model case FbxLayerElementUV eDirect case FbxLayerElementUV eIndexToDirect uv.x pFbxLayerElementUV gt GetDirectArray().GetAt(uvIndex).mData 0 uv.y pFbxLayerElementUV gt GetDirectArray().GetAt(uvIndex).mData 1 break break I am doing V 1.0 uv.y because I am using Direct3D11. NOTE the MappingMode is always eByPolygonVertex and ReferenceMode is always eIndexToDirect Rendering Info Rendered as a Triangle List Uv wrapping mode Wrap (Repeat) Culling None


Is the new windows 8 sdk usable with visual c express 2010 on windows 7? This is inspired by and related to Is the June 2010 DX SDK really the latest? asked recently but it's a different question. I won't likely be purchasing the full visual studio 2012 for C , I intend to use the free visual c express 2012 that targets desktop applications when it is released so for now I'm using visual c express 2010 running on windows 7. The latest directx11 sdk is the one included in the windows 8 SDK now, it's not a separate release any more. So my question is, can I use the windows 8 SDK to build directx11 programs that work on windows 7 using visual studio express 2010 running on windows 7. Or do I need to stick to the final DirectX SDK release for now?


How would I implement render scaling in a DX11 game? I would like to implement render scaling that could render a scene at a certain of the window resolution. How would I do this? I've tried resizing a number of things, then resizing them up or down to match the window size but I've never gotten it to work.


How can I read texel data on a separate thread in D3D11? In D3D10, I load a staging texture onto my GPU memory, then map it in order to access its texel data on the CPU. This is done on a separate thread, not the thread I render with. I just call the device methods, and it works. In D3D11 I load the staging texture onto my GPU, but to access it (i.e. Map it) I need to use the Context, not the device. Can't use the immediate context, since the immediate context can only be used by a single thread at a time. But I also can't use a deferred context to Read from the texture to the CPU "If you call Map on a deferred context, you can only pass D3D11 MAP WRITE DISCARD, D3D11 MAP WRITE NO OVERWRITE, or both to the MapType parameter. Other D3D11 MAP typed values are not supported for a deferred context." http msdn.microsoft.com en us library ff476457.aspx Ok, so what am I supposed to do now? It is common to use textures to store certain data (heightmaps for instance) and you obviously have to be able to access that data for it to be useful. Is there no way for me to do this in a separate thread with D3D11?


Occlusion culling of BV tree nodes behind terrain So I have a bounding volume tree, almost an octree but not quite. Anyway I'm trying to optimize my drawing, right now I have a few different culling frustums that I use to cull different ranges of the BV tree, its very fast, I can pull all my world data in less than 1ms but when it comes to culling the grass and the other mesh data I'm thinking that because I have lots of mountains and hill that I'm rendering stuff that is inside the frustum but occluded but hills and mountains. What would be the right way to cull this? Should I do a ray cast against my terrain from each corner of the bounding boxes to the player and cull anything that gets a hit? or should I find some fancy way to do it on the GPU?. I only have to test maybe 1k boxes x 8 corners, so the ray casting shouldn't take to long.


How can I make a character walk on uneven walls in a 2D platformer? I want to have a playable character who can "walk" on an organic surface at any angle, including sideways and upside down. By "organic" levels with slanted and curved features instead of straight lines at 90 degree angles. I'm currently working in AS3 (moderate amateur experience) and using Nape (pretty much a newbie) for basic gravity based physics, to which this walking mechanic will be an obvious exception. Is there a procedural way to do this kind of walk mechanic, perhaps using Nape constraints? Or would it be best to create explicit walking "paths" following the contours of the level surfaces and use them to constrain the walking movement?


In AS3, is it necessary to remove the children from a parent who is also being removed? My point is this addChild(parentMC) parentMC.addChild(child1) parentMC.addChild(child2) If I want to then remove parentMC from the current container, is it necessary to also remove child1 and child2 from parentMC in order to properly clean up? Or is that handled automatically through removing parentMC?


Export information to a custom file type from Air So I have an engine (air application) that basically (for now) is loading some windows on the screen stage, and you can drag them around. And later on, I'll be able to add other objects onto the stage. How would I export any kind of information (like co ordinates or sizes of windows) out of my application to an external custom file. And then I would use that file to reload a previous project if I were to re load the engine. I'm working in AS3 Air and in FlashDevelop. Thanks for the help and time. If anymore information is needed please let me know. Cheers.


Setting up speedtests in Actionscript 3 for an entire game I'm very new to this so please forgive the questions possibly ill stated nature. Firstly is this even a valid way to speedtest public function L1() tree.x 200 tree.y 200 tree.healthPoints 0 addChild(tree) var myTimer Timer new Timer(100,60) myTimer.addEventListener(TimerEvent.TIMER,someFunction) myTimer.start() addEventListener(Event.ENTER FRAME, speedTest) function someFunction(event TimerEvent) t public function speedTest (e Event) if (tree ! null) do tree.healthPoints 1 while (tree.healthPoints lt 10000) tree.healthPoints 0 trace (t) Secondly I want to actually speed test the entire game somehow to check if adding new features or rewriting current features actually optimizes the game or not. What are some ways to do this?


Animating Tile with Blitting taking up Memory I am trying to animate a specific tile in my 2d Array, using blitting. The animation consists of three different 16x16 sprites in a tilesheet. Now that works perfect with the code below. BUT it's causing memory leakage. Every second the FlashPlayer is taking up 140 kb more in memory. What part of the following code could possibly cause the leak The variable Rectangle finds where on the 2d array we should clear the pixels Fillrect follows up by setting alpha 0 at that spot before we copy in nxt Sprite Tiletype is a variable that holds what kind of tile the next tile in animation is (from tileSheet) drawTile() gets Sprite from tilesheet and copyPixels it into right position on canvas public function animateSprite() void tileGround.bitmapData.lock() if(anmArray 0 .tileType gt 42) anmArray 0 .tileType 40 frameCount 0 var rect Rectangle new Rectangle(anmArray 0 .xtile ts, anmArray 0 .ytile ts, ts, ts) tileGround.bitmapData.fillRect(rect, 0) anmArray 0 .tileType 40 frameCount drawTile(anmArray 0 .tileType, anmArray 0 .xtile, anmArray 0 .ytile) frameCount tileGround.bitmapData.unlock() public function drawTile(spriteType int, xt int, yt int) void var tileSprite Bitmap getImageFromSheet(spriteType, ts) var rec Rectangle new Rectangle(0, 0, ts, ts) var pt Point new Point(xt ts, yt ts) tileGround.bitmapData.copyPixels(tileSprite.bitmapData, rec, pt, null, null, true) public function getImageFromSheet(spriteType int, size int) Bitmap var sheetColumns int tSheet.width ts var col int spriteType sheetColumns var row int Math.floor(spriteType sheetColumns) var rec Rectangle new Rectangle(col ts, row ts, size, size) var pt Point new Point(0,0) var correctTile Bitmap new Bitmap(new BitmapData(size, size, false, 0)) correctTile.bitmapData.copyPixels(tSheet, rec, pt, null, null, true) return correctTile


How to set blur on mouse over and remove on mouse out in AS3? How can I do it? I want to active glow when the mouse is over a Sprite and remove it when the mouse is out. Is it possible? I have the following code var myGlow GlowFilter new GlowFilter() myGlow.color 0xFFFFFF myGlow.blurX glowMobilha.blurY 20 var miniatura MovieClip scene.d1 link miniatura.addEventListener(MouseEvent.CLICK, function(e Event) void MainSoundManager. sm.stopAllSounds() GameManager.loadSection(link, false) ) miniatura.addEventListener(MouseEvent.MOUSE OVER, function(e Event) void miniatura.filters myGlow miniatura.gotoAndStop(2) control.visible true controle.gotoAndPlay(2) ) miniatura.addEventListener(MouseEvent.MOUSE OUT, function(e Event) void miniatura.gotoAndStop(1) control.visible false control.gotoAndStop(1) ) miniatura.buttonMode true I set the blur at miniatura.addEventListener(MouseEvent.MOUSE OVER, function(e Event) void miniatura.filters myGlow miniatura.gotoAndStop(2) control.visible true controle.gotoAndPlay(2) ) How can I "hide" the blur at miniatura.addEventListener(MouseEvent.MOUSE OUT, function(e Event) void miniatura.gotoAndStop(1) control.visible false control.gotoAndStop(1) ) UPDATE I think I found the solution in the following code miniatura.addEventListener(MouseEvent.MOUSE OVER, function(e Event) void glowMobilha.alpha 1 miniatura.filters glowMobilha controle.visible true controle.gotoAndPlay(2) ) miniatura.addEventListener(MouseEvent.MOUSE OUT, function(e Event) void glowMobilha.alpha 0 miniatura.filters glowMobilha controle.visible false controle.gotoAndStop(1) ) is it the best solution?


Air AS3 Desktop Detecting wrong screen resolution and coordinate offset I have an issue with developing an Air desktop app using FlashDevelop in ActionScript 3.0 I'm pretty much new to all this, but I think I made all I should and am wondering if this could be some bug outside my code. My screen and desktop composition is as follows 1x Surface pro 3 with Multitouch 2160x1440 screen on the left (Identified as Screen 1) 1x Dell P2314T Multitouch with 1920x1080 screen in the middle (Identified as Screen 2) 1x Dell P2314T Multitouch with 1920x1080 screen on the right (Identified as Screen 3) When I run Air app with fullscreen mode with stage.displayState StageDisplayState.FULL SCREEN stage.scaleMode StageScaleMode.NO SCALE I get it on the Surface's screen on fullscreen, it being the windows Main display. If I trace the stage.nativeWindow.width and stage.nativeWindow.height I get the correct resolution. Now since I wanted the app to run on the 23" screen, I set Screen 2 to be the Main display in windows. Now AIR app is ran on the screen 2 by default, thus reporting the stage width and height being 1920 and 1080. However, the child sprites I have on stage with coordinate x 0 are outside my screen area! They are not visible on the screen on the left, but simply hidden like they're outside of the stage. If I put first child x offset to 120 (half of the difference between 1920 and 2160 screen widths), it's positioned approx on the left edge. To see better what's going on, I went to screen resolution manager and disabled the internal Surface's screen completely ("Don't show desktop on this screen", thus leaving me with 2x 1920x1080 screens only. If I run the code now, the stage.nativeWindow.width and height are reporting resolution of 2160x1440 that's screen 1, which is disabled and has no image on it at all. The Sprite x offset issue remains the same, being 120 in minus. The code is completely clear, having stage with single sprite and quad drawn. public class Main extends Sprite static public var instance Main public function Main() instance this Multitouch.inputMode MultitouchInputMode.TOUCH POINT stage.displayState StageDisplayState.FULL SCREEN stage.scaleMode StageScaleMode.NO SCALE stage.nativeWindow.alwaysInFront true trace( String(stage.nativeWindow.x) ' y ' String(stage.nativeWindow.y) ' size h ' String(stage.nativeWindow.height) ' w ' String(stage.nativeWindow.width) ) init() private function init() void frame new Sprite frame.x 120 frame.y 450 addChild(frame) trace('frame x ' frame.x) What could possibly cause such error? Could someone confirm whether this error is reproducible? Thanks! Edit 1 Ok, seems like the failed offset was fixed adding the stage align property in main stage.align StageAlign.TOP LEFT I'm still interested to know why the runtime default align happens using scree 1 instead of main's resolution, and therefore fails to be correct though! The magic about wrong resolution still stays the same, and can't be reproduced using two different screens (AOC 1920x1080 and Dell 1920x1200) in same composition, using same settings. Weird...


AS3 Client not sending movement to server I am having trouble with multiplayer player movement in my game. The client is in AS3 and the server is in C . Here is my problem When I first launch the game, it connects to the server, and everything works fine. But... when I try to move my player, it isn't sending the UTF8 bytes over to the server. I even have it trace output after the socket sends the bytes. I sent the exact same bytes to the server when the game started just to see if the server recognized it, and it did. I am not sure why it isn't even sending it at all. This is very frustrating. private function keyDown(event KeyboardEvent) void switch(event.keyCode) case Keyboard.W up true break case Keyboard.S down true break case Keyboard.A left true break case Keyboard.D right true break private function keyUp(event KeyboardEvent) void switch(event.keyCode) case Keyboard.W up false break case Keyboard.S down false break case Keyboard.A left false break case Keyboard.D right false break private var playerSpdTemp int 5 private function enterFrame(e Event) void if (up) archer.y playerSpdTemp socket.writeUTFBytes("move " archer.x " " archer.y) trace("Sent...") if (left) archer.x playerSpdTemp if (down) archer.y playerSpdTemp if (right) archer.x playerSpdTemp I tried putting the socket.writeUTFBytes() in the keyDown and keyUp functions but nothing happens either... And yes, I have the correct event listeners set up. The player moves correctly but not the socket.


Read an object from compressed file generated from ActionScript 3 I have made a simple game Map Editor and I want to save a array that contain map tile info to a file, as below var arr Array .....2d tile info in it... var ba ByteArray new ByteArray() ba.writeObject(arr) ba.compress() var file File new File() file.save(ba) I had successfully saved a compressed object to a file. Now the problem is my server side need to read this file and decompress the array out from the file, then convert it to a Python list. Is that possible?


Walk to nearest attackable range node My game has 3D environment which is partitioned in 2d cells(nodes). I have implemented A for path finding. Now I am just breaking my head to how to implement the algorithm to move the hero to the nearest attackable range node point when the enemy is out of attack able range. Which means, it should satisfy two conditions Target whithin attackable range No obstacles in between the target and attacker See below picture (pardon for my bad drawings) Brown boxes are obstacles Attacker hero is in the cell highlighted with Turquoise color dot, the circle is the radius size of the model. Target is the red dotted color cell, surrounded with red color circle to indicate the size of the model Green circle is the radius where hero has to move to some where inside that location to attack (its the radius of hero's attack range) Blue dots are the A path to reach from hero position to target position When the player issues attack command, hero should move to the nearest attack able node and start attacking. Finally I thought of below algorithm Calculate radius to scan This is the sum of attacker radius attacker weapon radius target radius Get nodes fall within the radius (from step 1) from targets position Find path from attacker to target using A Keep walking in the path (from step 3) check if current node is in the scanned nodes (from step 1) If true, Check that no obstacle are in between If true, attack, if false keep walking (repeat step 4) If we put together the algorithm and the figure1 The A gets the path of 9 node to reach the target After moving 5 steps, it enters the attackable range, since there is obstacle between the target, it take two more steps where it finds no obstacles and stats attacking. I am not sure if this is the optimized method to achieve this but I am not getting alternative solution. Very particular to the steps 2 5 which looks little weird and process intensive to me. I am using actionscript 3 and Flare3D (Stage3D API)


How to use Pixel Bender (pbj) in ActionScript3 on large Vectors to make fast calculations? Remember my old question 2d game view camera zoom, rotation amp offset using 39 Filter 39 39 Shader 39 processing? I figured I could use a Pixel Bender Shader to do the computation for any large group of elements in a game to save on processing time. At least it's a theory worth checking. I also read this question Pass large array to pixel shader Which I'm guessing is about accomplishing the same thing in a different language. I read this tutorial http unitzeroone.com blog 2009 03 18 flash 10 massive amounts of 3d particles with alchemy source included I am attempting to do some tests. Here is some of the code private const SIZE int Math.pow(10, 5) private var testVectorNum Vector. lt Number gt private function testShader() void shader.data.ab.value 1.0, 8.0 shader.data.src.input testVectorNum shader.data.src.width SIZE 400 shader.data.src.height 100 shaderJob new ShaderJob(shader, testVectorNum, SIZE 4, 1) var time int getTimer(), i int 0 shaderJob.start(true) trace("TEST1 ", getTimer() time) The problem is that I keep getting a error saying Fault exception, information Error Error 1000 The system is out of memory. Update I managed to partially workaround the problem by converting the vector into bitmapData (Using this technique I still get a speed boost of 3x using Pixel Bender) private function testShader() void shader.data.ab.value 1.0, 8.0 var time int getTimer(), i int 0 testBitmapData.setVector(testBitmapData.rect, testVectorInt) shader.data.src.input testBitmapData shaderJob new ShaderJob(shader, testBitmapData) shaderJob.start(true) testVectorInt testBitmapData.getVector(testBitmapData.rect) trace("TEST1 ", getTimer() time)


AS3 Using singletons for sound managers Is it necessarily a bad thing to use a singleton for a sound manager? I am having a really tough time determining whether or not I should go ahead and use a singleton (which is easy it works) or if I am shooting myself in the foot by deviating away from good OOP principles (since a singleton is basically a glorified single instance global variable of sorts).


Can anyone explain step by step how the as3isolib depth sorts isometric objects? The library manages to depth sort correctly, even when using items of non 1x1 sizes. I took a look through the code but it's a big project to go through line by line! There are some questions about the process such as How are the x, y, z values of each object defined? Are they the center points of the objects or something else? I noticed that the IBounds defines the bounds of the object. If you were to visualise a cuboid of 40, 40, 90 in size, where would each of the IBounds metrics be? I would like to know how as3isolib achieves this although I would also be happy with a generalised pseudo code version. At present I have a system that works 90 of the time but in cases of objects that are along the same horizontal line, the depth is calculated as the same value. The depth calculation currently works like this x object horizontal center point y object vertical center point originX and Y the origin point relative to the object so if you want the origin to be the center, the value would be originX 0.5, originY 0.5. If you wanted the origin to be vertical center, horizontal far right of the object it would be originX 1.0, originY 0.5. The origin adjusts the position that the object is transformed from. AABB width The bounding box width. AABB height The bounding box height. depth x (AABB width originX) y (AABB height originY) z This generates the same depth for all objects along the same horizontal x.


Enemy collision detection with movie clips I have created multiple movieclips with animations within them. It is an obstacle avoidance game and I cannot seem to be able to get my enemies to contact my playableCharacter. The enemies I have created are each embedded on certain levels of my game. I have created an array, enemiesArray to have each of my enemies placed within it. Here is the code for that step 1 make sure array exists if(enemiesArray! null amp amp enemiesArray.length! 0) step 2 check all enemies against villain for(var i int 0 i lt enemiesArray.length i ) step 3 check for collision if(villain.hitTestObject(enemiesArray i )) step 4 do stuff trace("HIT!") removeChild(enemiesArray i ) enemiesArray.splice(i,1) removeChild(villain) villain null What I am unsure of is whether or not my enemiesArray is actually holding the movieclips I have suggested. If it was, this code would be tracing back a "HIT" for every time I ran into an enemy and would kill my character. It is not doing that however. I am thinking I have to push my movieclips into my array but I don't know how to do that or where for that matter. Any and all help would be much appreciated.


Tiny Wings Placing items I'm currently developing a Flash game like 'Tiny Wings'. I have a lot of work done, but i'm currently working on placing the items ( coins and obstacles ) on the terrain. My player it is moving on a auto generated terrain (based on Emanuele Feronato's tutorials) so every time the player's x position is greater than (screenWidth x) another hill is generated and so on. I'm currently having problems placing the items in a correct angle and put 5 or more items together on a hill. Could you please help me with this? Thanks, Regards. PS This is the URL to the Emanuele Feronato post and the code to make the hills http www.emanueleferonato.com 2011 10 04 create a terrain like the one in tiny wings with flash and box2d E2 80 93 adding more bumps


Is there any way to change the layering of objects in Actionscript 3 without altering the run order? I'm making a simple platformer in Adobe Animate, and I need the player to be layered in front of the stage because of a gimmick in the game. Unfortunately, whenever I change the layering order, it also seems to change the order that AS3 runs the instances. Is there any way to change the layering order without affecting the instance order, or vice versa? I'm only just starting with programming, so please bear in mind that I probably won't understand many of the technical terms. Thanks in advance!


What are the advantages and challenges of using Haxe over ActionScript 3? I read this, and I also see that using FlashDevelop you can make an Adobe Air project with Haxe and compile to exe. I begun to wonder from a game making perspective Are there any additional advantages in performance when using Haxe instead of AS3 for games development (for the web)?


AS3 StageWidth for BOX2D? I know BOX2D uses meters, and AS3 uses pixels. I'm trying to create objects which are limited to the stageWidth. If I do this variable for (var i int 0 i lt (stage.stageWidth) i ) ... The animation will freeze, and this output appears TypeError Error 1009 Cannot access a property or method of a null object reference. at Box2D.Collision b2BroadPhase CreateProxy() at Box2D.Collision.Shapes b2Shape CreateProxy() at Box2D.Dynamics b2Body CreateShape() at com.actionsnippet.qbox.objects CircleObject build() at com.actionsnippet.qbox QuickObject init() at com.actionsnippet.qbox QuickObject() at com.actionsnippet.qbox.objects CircleObject() at com.actionsnippet.qbox QuickBox2D create() at com.actionsnippet.qbox QuickBox2D addCircle() at BOX2D Test Tutorial fla MainTimeline frame1() Does anyone know how to fix this? Full Code SWF(width 350, height 600, frameRate 60) import com.actionsnippet.qbox. var sim QuickBox2D new QuickBox2D(this) sim.createStageWalls() make a heavy circle sim.addCircle( x 3, y 3, radius 0.4, density 1 ) create a few platforms make pins for (var i int 0 i lt (stage.stageWidth) i ) End sim.addCircle( x 1 i 1.5, y 18, radius 0.1, density 0 ) sim.addCircle( x 2 i 1.5, y 17, radius 0.1, density 0 ) sim.addCircle( x 1 i 1.5, y 16, radius 0.1, density 0 ) sim.addCircle( x 2 i 1.5, y 15, radius 0.1, density 0 ) Mid end sim.addCircle( x 0 i 2, y 14, radius 0.1, density 0 ) sim.addCircle( x 0 i 2, y 13, radius 0.1, density 0 ) sim.addCircle( x 0 i 2, y 12, radius 0.1, density 0 ) sim.addCircle( x 0 i 2, y 11, radius 0.1, density 0 ) sim.addCircle( x 0 i 2, y 10, radius 0.1, density 0 ) sim.start() sim.mouseDrag()


AS3 random events using a timer I'm making a game for an assignment at university. The game I am making requires random household appliances around a house to "turn on" at random times. The player must run around the house turning this off. I am confident with the rest of the code for the game, but the random turning on is what I'm not sure on. I am thinking the solution would be to use an array with all my appliances pushed into into, then create a timer event. From this a random time would be picked from the timer, and then a random appliance would be picked from the array. The appliance on animation would then be displayed until the player clicked on it to turn it off. Only problem is i'm not sure how to start this. Also worth mentioning, I am only able to use flashdevelop and AS3 for this project, so no Adobe Flash. Thanks in advance, Job4aCowboy


What's a good Flash game development tutorial, in FlashDevelop, for an absolute beginner? Ok, here's my situation I'm tutoring a 14yo homeschooled student with very little previous programming experience, and I'd like to teach her how to program. I think that Flash Actionscript 3 is a good resource for her to start out with, mostly because she seems to have an interest in game development. I've decided that FlashDevelop, used alone, is the best interface for her to use, especially as she becomes more proficient in Flash. The trouble is, while I am an extremely competent Web programmer in other languages, I have no experience with Actionscript at all, and I can't find a good tutorial for her to use. The tutorial doesn't need to have the algorithmical basics of programming, like the concept of loops, if statements, OOP, etc I can teach her those. What I need is a tutorial that teaches Actionscript SYNTAX and walks you through the steps of game development in FlashDevelop. Once I have that, I can do everything else. Can anyone help me?


Using Event Driven Programming in games, when is it beneficial? I am doing a refresher on ActionScript 3. Other than using rudimentary tools like, Event.ENTER FRAME and using events to receive input from the user's mouse and keyboard, I find that I rarely use events and prefer to use public functions. I am starting to reconsider this approach. From what I have learned thus far, the event system works this way Each dispatcher can listen to itself during the target phase. Each display object on the stage, can listen to it's children before the target phase, during Capture or after the target phase, during bubbling. I would like to see an example of good use of the Event class for game programming. Have you used Event driven programming in a game and have a good example you could share? A lot of times I want to pass a message to a 'sibling' so I could have their methods listen to the stage or the parent object. Is that the best way to communicate between objects that are not parents of the dispatcher they want to listen to? I would like to know if events are better performance wise than public functions. Are there cases where using events can result in superior performance than avoiding events and sticking to function calls?


What is the best toolchain for ActionScript3 social networks game development? I'm new to flash and web development too. But I have some background in c c Qt python. So, I want to know, what is the best toolchain for quickest dive into. My task is to write a game for facebook.com vkontakte.ru. I already have the design doc, great artist and game designer, so, the coding is the only stumbling block we met. There are no significant obstacles at server side, but, since we have not much time, I decided to ask some help on suitable toolchain definition. I think, that web services (maybe WCF) are perfect for the backend, so, some of them should transfer JSON ed data from to client, incapsulate game logic, and... here is the place I stuck. What next, what should I learn, what tools toolsets will provide learing productivity curve that meat least action principle. Maybe I'm on the wrong way and missing some basic and obvious (for web devs) things... I do not know, so, any advices will be highly appreciated. Yes, this is the copy of my question on SO, but it seems, that here is the really proper place to post it.


Target tracking with a small delay (actionscript 3.0) I'm having trouble thinking of a good method to track my character with an enemy attack. Of course, I don't want the attack to track my character's current position I want it to track where the character was about 1 second before (so you can move around and make the attack miss and loop around you sort of a thing). The general structure of my game uses a timer to update all of my events. I have a timer going off every 25 milliseconds that updates everything, including my player's position and the enemies position. Right now I just have the enemy attack directly targeting my character....which works fine except that it's impossible to escape p. Let me know if I didn't supply enough details. My approach was going to basically be get my character's position from about 1 second ago, then have the enemy target that position, the only problem is I can't think of a good way to get my character's position from previous times. Thanks for the help!


How can I respond to mouse events in AS3? Background Trying to make a simple "drop the ball" game. The code is located inside the first frame of the timeline. Nothing more is on the stage. Issue Using QuickBox2D I made a simple If statement that drops and object acording the Mouse x position if (MouseEvent.CLICK) sim.addCircle( x mouseX, y 1, radius 0.25, density 5 ) I imported the MouseEvent library import flash.events.MouseEvent Nothing happens if I click, no output errors either. See it in action http gabrielmeono.com download Lucky Hit Alpha.swf http gabrielmeono.com download Lucky Hit Alpha.fla Full Code SWF(width 350, height 600, frameRate 60) import com.actionsnippet.qbox. import flash.events.MouseEvent var sim QuickBox2D new QuickBox2D(this) sim.createStageWalls() var ball sim.addCircle( x mouseX, y 1, radius 0.25, density 5 ) make a heavy circle sim.addCircle( x 3, y 1, radius 0.25, density 5 ) sim.addCircle( x 2, y 1, radius 0.25, density 5 ) sim.addCircle( x 4, y 1, radius 0.25, density 5 ) sim.addCircle( x 5, y 1, radius 0.25, density 5 ) sim.addCircle( x 6, y 1, radius 0.25, density 5 ) create a few platforms sim.addBox( x 3, y 2, width 4, height 0.2, density 0, angle 0.1 ) make 26 dominoes for (var i int 0 i lt 7 i ) End sim.addCircle( x 1 i 1.5, y 16, radius 0.1, density 0 ) sim.addCircle( x 2 i 1.5, y 15, radius 0.1, density 0 ) Mid end sim.addCircle( x 0 i 2, y 14, radius 0.1, density 0 ) sim.addCircle( x 0 i 2, y 13, radius 0.1, density 0 ) sim.addCircle( x 0 i 2, y 12, radius 0.1, density 0 ) sim.addCircle( x 0 i 2, y 11, radius 0.1, density 0 ) sim.addCircle( x 0 i 2, y 10, radius 0.1, density 0 ) Middle Start sim.addCircle( x 0 i 1.5, y 09, radius 0.1, density 0 ) sim.addCircle( x 1 i 1.5, y 08, radius 0.1, density 0 ) sim.addCircle( x 0 i 1.5, y 07, radius 0.1, density 0 ) sim.addCircle( x 1 i 1.5, y 06, radius 0.1, density 0 ) if (MouseEvent.CLICK) sim.addCircle( x mouseX, y 1, radius 0.25, density 5 ) sim.start() sim.mouseDrag()


Dynamic entities using classes and objects I'm trying to create a program which involves the creation of several characters entities. At the moment I have a Base Entity class an Entities class and a Main class. I can handle one entity alright, however I am trying to create each one editable through a standard function call. Main Class http pastebin.com AjgEBSke Entity Class http pastebin.com 5y2wD3Qc BaseEntity Class http pastebin.com VfqRgeng I feel a little confused on how to dynamically call and edit each specific character without limiting myself to lots of 'if' statements. I have tried to restart this project several times... Basically I'm creating a private object in a class. That class will be used to talk to that private object, Save, load and edit etc. Then in a seperate Entities class I create an instance of that object, this is where I think im getting caught up. As far as I know, I need to handle everything I want to do in that entity in this entity class. I give the entity object an ID, and a default name which I want to be able edit later. I also want to eventually be able to call that entity from other classes to 'draw' it, have it return the values I need to draw it, Name, body type etc (other variables in the object). I have managed to interact with a specific instance of the object class by checking if the String is equal to an objects ID and then doing something, this however I feel is not dynamic and I'll just get into a bigger mess. Ideally I think I want to be able to enter the object's class' instance name as a string and have it handle everything. Sorry this has been rather long, if you know of any articles or information on how I'd learn to create dynamic entities to do what I need to do, that'd be great. Im probably looking more for an explanation of the concept of what I'm trying to do as i've only just really sketched up this code. So this code might be a little pointless at the momemnt. Ive attempted it a few times, trying to set things up better each time, however ultimately fail when I try to make things behave dynamically. If i'm going about this completely the wrong way then please tell me as I'm still learning and don't want to get into the habit of doing things badly.


how to save data in a visual novel with shared object I've been looking for ways to save data in a visual novel, I have seen that the best way to do is with shared object but the tutorials are usually saved scores and I want to save the history progression how can I do it? Which variable should be used? What should contain the variable? shared object works for android and ios? Thanks for reading


Animate Interpolate and wait for completion. I'm implementing a blackjack game in flash and so far the logic is fine but there is no animation for the cards so they just appear and disappear which doesn't look very pleasing to the eye. I want to add some animations for when cards are dealt where they slide across to their position one by one. Is there a simple way to just tell a displayobject to interpolate from one position to another while waiting for it to complete? My current thought would be to just do something like this on enter frame if a card is animating move it further towards its destination continue else (if it is done animating) process as usual end end I believe this would produce the results I'd expect because the game should only continue after the card being dealt is where it should be. However, this feels like a weird approach and I'm probably over thinking it which is why I'd like to know if any of you have a better solution.


Best way to create neon glow line effect in AS3? What's the best way to create a neon glow line effect in Flash AS3? Say similar to what's going on in the game gravitron360 on the xbox 360? Would it be a good idea to create movieclips with plain lines drawn in them and then apply a glow filter to them? or perhaps just apply the glow filter to the entire movieclip layer the movieclips are on? or just draw them manually and create a glow effect by converting the lines to fills and then softening edges? (wouldn't blend as well but would be the fastest CPU wise?) Thanks for any help


Read an object from compressed file generated from ActionScript 3 I have made a simple game Map Editor and I want to save a array that contain map tile info to a file, as below var arr Array .....2d tile info in it... var ba ByteArray new ByteArray() ba.writeObject(arr) ba.compress() var file File new File() file.save(ba) I had successfully saved a compressed object to a file. Now the problem is my server side need to read this file and decompress the array out from the file, then convert it to a Python list. Is that possible?


AS3 Using singletons for sound managers Is it necessarily a bad thing to use a singleton for a sound manager? I am having a really tough time determining whether or not I should go ahead and use a singleton (which is easy it works) or if I am shooting myself in the foot by deviating away from good OOP principles (since a singleton is basically a glorified single instance global variable of sorts).


How to add a movieclip to the stage then make it move down? I am making a game where i want to spawn zombies then make them move down the screen. I also want to have multiple on the screen at once. I have tried multiple ways now but none of them have worked. Here is my code if ((zombie 1) (zombie 3) (zombie 5) (zombie 7)) var Z new Z Z.x 403.25 Z.y 86.9 Z.rotation 90 addChild(Z) zombie 1 Functions function startzombie(event) trace("start zombies") zombie 1 addEventListener(Event.ENTER FRAME,zombiemove) function zombiemove(event Event) Z.y 1 Z is the zombie


How can I make an movieclip move in a circular path with GTween? How can I make an movieclip move in a circular path with GTween? it's straightforward to have something move with various easing effects in a line or a curve, but I would need a complete circular path.


Is it more efficient to store my tile grid as a dictionary or an array? I've just started making a video game in AS3, and I'm trying to keep the graphics, sound, and actual game state in three completely different spots and sets of classes. That being the case, the graphics module will have to repeatedly parse the state module. The game is divided into levels, and each level is divided up into square spaces (like a board game) thus the graphics module will have to repeatedly parse out a certain cross section of spaces of the current level. The player will always show up in the middle of the spaces' overall graphic (the "Grid"), and there will be 4 spaces in every direction from the player's positioin that will be displayed, along with any object each space may contain (such as the player, a monster, etc.). So right now I'm trying to decide how to store the spaces in each level (all of the level's spaces themselves, not the graphics). The first thing that came to mind was a 2D Array. Then I started to use a 2D Vector, then came back to using an Array, like at first and now I'm wondering whether to use an Array or a Dictionary. The problem Let's say a level looks like this xxxxxxxxxxxx xxxxxxxxxxxx xxxxPxxxxxxx x's are blank spaces, P is the space that the player. As the Grid parses this information, if it's a 2D Array, then it can use the length property of the main Array and the length property of each sub array to set up its for loops reasonably well. Furthermore if a space is outside the bounds of the 2D array, then rather than wasting memory trying to form more objects in the code or something, the Grid can just assume the space is blank var arr Array var space Space for (var i int level.playerX 4 i lt level.playerX i ) arr level.spaces i if (arr) for (var j int level.playerY 4 j lt level.playerY j ) space arr j if (space) find every object inside space and animate accordingly else assume the space is blank else assume the whole column of spaces is blank Within the player's radius, the Grid must animate any non existent spaces as blanks. Therefore the graphical output is as follows xxxxxxxxx xxxxxxxxx xxxxxxxxx xxxxxxxxx xxxxPxxxx xxxxxxxxx xxxxxxxxx xxxxxxxxx xxxxxxxxx But now if we have a level that looks more like this xxxxxxxxxxxxx xxxxxxxxx Pxxxx xxxxx then using an Array leaves two basic options Use null elements within the sub arrays to get the Grid to animate non existent spaces that come before the real ones in the sub array (the sub array's length can be used for non existent spaces that come after the real ones). Make that simple for looping inside the Grid a whole lot more complex to compensate for rows and columns of spaces starting at variable locations along each axis (and not simply ending at variable locations). I don't want to use option 2. I was just going to use option 1 with Arrays, but now the possibility of using Dictionaries instead has come to mind. At least with Dictionaries, I wouldn't have to just waste memory every time I wanted, let's say, for the first space in a row to begin at postion 5. Sorry, I know this was lengthy, but I hope I've illustrated the problem. Which is better an Array, or a Dictionary? If a Dictionary is better, should it use sub Dictionaries or sub Arrays to establish a 2 dimensional effect? Thanks!


Show a range grid movement as3 How do I show range of grid movement in AS3? When player controls a character and chooses "move" options, the grid of movement will be displayed as 3 grid of X, 4 grid of Y (Both sides, and ). So, it will be like this In the image above, movement grid displayed in blue color. But, how do i display a range grid movement like that?


Incorrect angle calculation? I'm trying to create a simple topdown game, in which you control the player by WASD keys and use mouse to aim and shoot. So far, I have a player moving and firing, but I think there is something wrong with the shooting. Accuracy gets lower as the mouse cursor move away from the player. Please try the following SWF to see more clearly what I'm trying to say. http dl.dropbox.com u 24777511 gdstack.swf Here is a chunk of relevant code private function fireBullet(x Number, y Number, dFireAngle Number) void var b Bullet recycleBullet() var rFireAngle Number b.reset(x, y) b.angle dFireAngle rFireAngle (dFireAngle (Math.PI 180)) b.velocity.x Math.cos(rFireAngle) 385 b.velocity.y Math.sin(rFireAngle) 385 ... if (FlxG.mouse.pressed()) var p FlxPoint new FlxPoint(FlxG.mouse.screenX, FlxG.mouse.screenY) var angle Number FlxU.getAngle(new FlxPoint(player.x, player.y), p) 90 fireBullet(player.x, player.y, angle) ...


How would you recommend I get started with ActionScript 3? I wanted to make Flash games so I bought the book "Flash Games Development with AS3." I did the 'hello, world' program by trace and addChild (or something like that). But the problem was, instead of understanding what I was writing, I was just copying and pasting those lines of code. I felt it wouldn't work that way, and as the book had asked the learners to know at least some Java Javascript, C C , I didn't go any further. Now, I want to start again (and yes, I still don't know Java or C programming). What would you recommend for me? Thanks )


Walk to nearest attackable range node My game has 3D environment which is partitioned in 2d cells(nodes). I have implemented A for path finding. Now I am just breaking my head to how to implement the algorithm to move the hero to the nearest attackable range node point when the enemy is out of attack able range. Which means, it should satisfy two conditions Target whithin attackable range No obstacles in between the target and attacker See below picture (pardon for my bad drawings) Brown boxes are obstacles Attacker hero is in the cell highlighted with Turquoise color dot, the circle is the radius size of the model. Target is the red dotted color cell, surrounded with red color circle to indicate the size of the model Green circle is the radius where hero has to move to some where inside that location to attack (its the radius of hero's attack range) Blue dots are the A path to reach from hero position to target position When the player issues attack command, hero should move to the nearest attack able node and start attacking. Finally I thought of below algorithm Calculate radius to scan This is the sum of attacker radius attacker weapon radius target radius Get nodes fall within the radius (from step 1) from targets position Find path from attacker to target using A Keep walking in the path (from step 3) check if current node is in the scanned nodes (from step 1) If true, Check that no obstacle are in between If true, attack, if false keep walking (repeat step 4) If we put together the algorithm and the figure1 The A gets the path of 9 node to reach the target After moving 5 steps, it enters the attackable range, since there is obstacle between the target, it take two more steps where it finds no obstacles and stats attacking. I am not sure if this is the optimized method to achieve this but I am not getting alternative solution. Very particular to the steps 2 5 which looks little weird and process intensive to me. I am using actionscript 3 and Flare3D (Stage3D API)


Export information to a custom file type from Air So I have an engine (air application) that basically (for now) is loading some windows on the screen stage, and you can drag them around. And later on, I'll be able to add other objects onto the stage. How would I export any kind of information (like co ordinates or sizes of windows) out of my application to an external custom file. And then I would use that file to reload a previous project if I were to re load the engine. I'm working in AS3 Air and in FlashDevelop. Thanks for the help and time. If anymore information is needed please let me know. Cheers.


Efficient Sprite Batching Am considering porting over from XNA to the Stage3D API's (Molehill). So as a performance examination I've implemented sprite batching, but the performance is not all that great, while with XNA i can easily draw up to 500 000 quads but with my Molehill implementation i can draw around a measly 1000 quads and while a rather dramatic performance difference was expected on the CPU side this is due to being GPU bound. So currently the implementation is as follows. set render states let texture be null let batchSize be arbitrary for each sprite in queue if texture is not sprite texture or buffers are full upload vertex data to index buffer upload index data to vertex buffer bind texture draw triangles flush vertex data flush index data add sprite vertices to vertex data add sprite indices to index data end upload remaining vertex data to vertex buffer upload remaining index data to index buffer draw remaining triangles flush data The bottleneck is uploading the buffers, but as for a better implementation I'm hoping for a discussion here. Cheers. Revision One optimization that comes to mind is to persist the index buffer, since the indices are predictable and will always follow the same format. Am going to benchmark that now. Caching the index buffer had no noticeable performance gains, so in an effort to try to understand where the bottleneck is, I ported it over to C XNA, ever so slightly slower than Microsoft's implementation but still has a GPU capacity over 500 times more than the Molehill implementation. Is Molehill simply an extremely bad abstraction layer?


Workflow with Flash Pro CS6 and FlashDevelop Using fla and swc to store assets I am using this tutorial http www.flashdevelop.org wikidocs index.php?title AS3 FlexAndFlashCS3Workflow In the past older versions of Flash Pro I was able to complete these steps right click on the symbol in the Library panel, select "Linkage..." dialog, check "Export for ActionScript" and fill in the symbol name (ie. MySymbol design or assets.MySymbol design), do not change the base class (ie. flash.display.MovieClip). Right now, I am stuck at that part. Any hints? What I wish to do is Use fla for the artist to store assets. Publish to swc Extract the assets in FlashDevelop by creating an instance of their class. ... How is this done in CS6? To clear things up, this is what I see when I right click a Flash symbol


Is there any way to change the layering of objects in Actionscript 3 without altering the run order? I'm making a simple platformer in Adobe Animate, and I need the player to be layered in front of the stage because of a gimmick in the game. Unfortunately, whenever I change the layering order, it also seems to change the order that AS3 runs the instances. Is there any way to change the layering order without affecting the instance order, or vice versa? I'm only just starting with programming, so please bear in mind that I probably won't understand many of the technical terms. Thanks in advance!


What is a good approach for making a relationship between the HUD and Environment? What is an elegant common way to build a relationship between the game scene environment world and the HUD that usually sits on top of it? I have thought about this for a while, and though there are ways to accomplish this that are easy to implement, they always seem to expose too much unrelated information between the two, or end up being too coupled. An example of this that I have used in the past would be to simply pass reference from the HUD to the Environment and vice versa (which is obviously not a good apporach for many reasons, especially when aiming for low coupling). What I want to end up with is a clean, uncoupled way to do things like From the HUD reference and manipulate objects within the environment, change the state of the Environment itself. From the environment update the HUD to reflect the current state of the environment. Maybe passing reference between the two is the way to go about this, but I feel like there's some pattern that I am missing for this type of task. Any insights into past experience and implementations concerning this type of problem would be very helpful.


How to set blur on mouse over and remove on mouse out in AS3? How can I do it? I want to active glow when the mouse is over a Sprite and remove it when the mouse is out. Is it possible? I have the following code var myGlow GlowFilter new GlowFilter() myGlow.color 0xFFFFFF myGlow.blurX glowMobilha.blurY 20 var miniatura MovieClip scene.d1 link miniatura.addEventListener(MouseEvent.CLICK, function(e Event) void MainSoundManager. sm.stopAllSounds() GameManager.loadSection(link, false) ) miniatura.addEventListener(MouseEvent.MOUSE OVER, function(e Event) void miniatura.filters myGlow miniatura.gotoAndStop(2) control.visible true controle.gotoAndPlay(2) ) miniatura.addEventListener(MouseEvent.MOUSE OUT, function(e Event) void miniatura.gotoAndStop(1) control.visible false control.gotoAndStop(1) ) miniatura.buttonMode true I set the blur at miniatura.addEventListener(MouseEvent.MOUSE OVER, function(e Event) void miniatura.filters myGlow miniatura.gotoAndStop(2) control.visible true controle.gotoAndPlay(2) ) How can I "hide" the blur at miniatura.addEventListener(MouseEvent.MOUSE OUT, function(e Event) void miniatura.gotoAndStop(1) control.visible false control.gotoAndStop(1) ) UPDATE I think I found the solution in the following code miniatura.addEventListener(MouseEvent.MOUSE OVER, function(e Event) void glowMobilha.alpha 1 miniatura.filters glowMobilha controle.visible true controle.gotoAndPlay(2) ) miniatura.addEventListener(MouseEvent.MOUSE OUT, function(e Event) void glowMobilha.alpha 0 miniatura.filters glowMobilha controle.visible false controle.gotoAndStop(1) ) is it the best solution?


change the position of f3d objects randomly in action script I have a f3d object and have different boxes to place the parts of the f3d objects.When i click on the button change the position of the boxes randomly. How it possible?This is the code for random array. private function init(e Event null) void removeEventListener(Event.ADDED TO STAGE, init) entry point var startArray Array generateNumberArray(10) var randomArray Array randomArray(startArray) trace("startArray " startArray) trace("randomArray " randomArray) generate Array of numbers by length param length return Array of numbers public function generateNumberArray(length int) Array var numberArray Array for (var i int 0 i lt length i ) numberArray i i 1 trace("ersexrfegtdrgtdrygtfr" numberArray i ) return numberArray generate randomly mixed array by input array param inputArray simple not mixed array return Array mixed array public function randomArray(inputArray Array) Array var randomArray Array var tempArray Array for (var i int 0 i lt inputArray.length i ) tempArray.push(inputArray i ) while (tempArray.length) var randomNumber int Math.round(Math.random() (tempArray.length 1)) get random number of left array randomArray.push( tempArray randomNumber ) tempArray.splice(randomNumber, 1) trace("randommmmmmmmmmmmmmmmmmmmmmmm" randomArray) remove randomed element from temporary aarray tempArray null delete tempArray return randomArray public function loadCompleteEvent(e Event) void if (stage) init() else addEventListener(Event.ADDED TO STAGE, init) my boxes (want to change the position randomly of these boxes) Box2.setPosition(57.49752426147461, 2.987499237060547, 10) Box3.setPosition(57.49752426147461, 26.987499237060547, 10) Box4.setPosition( 48.50247573852539, 2.987499237060547, 10)


How can I disable the forward back buttons in AS3? How can I disable the Flash player forward and back button in AS3? These buttons make it possible to cheat in my game by moving from level to level.


Placing items randomly in a dynamically generated terrain I'm currently working on a 'Tiny wings' like game. I've already asked about the angle of the items in curved lines and i solved (thank you for responses),i'm currently placing the items in random positions, but the terrain it's dynamically and i don't get this working. I've a vector with the points of the terrain, and i'm doing something similar to this (Iterating trough vector) if( SPManager amp amp i 15 0 amp amp i ! 0 ) if ( settings.specialPoints amp amp currentPoints lt settings.specialPoints ) SPManager.addPoint( hillsPosition i .x , hillsPosition i .y ) currentPoints But it isn't working as i expected. It isn't displaying the right number of items (Always shows less than i specified). How do i should place the items? Thanks )


How can I output multiple sprite sheets from a single .fla? I have to produce out three sprite sheets of differing sizes. To do so, I have three different .fla source files. Obviously maintaining three files takes more time than maintaining one is there some way that I can use one .fla and produce three differently sized sprite sheets?


How to spawn objects and control the content in each spawn I'm using unreal engine and would like to spawn multiple actors and control the text in each spawned actor. How can this be achieved in unreal engine?


How to use X,Y, and Z instead of Pitch, Roll and Yaw I'm learning Unreal engine, and I'm rather disappointed because it uses pitch roll and yaw instead of the standard x, y, and z that I'm used to. Is there any way to convert this easily, or is there a preference, or do I have to get used to using y,z,x, instead of x,y,z.


Nonsense error in the overlap between 2 warriors and a tower I have a project where 1 warrior is generated every 5 seconds. This warrior as it is generated tries to follow a path that contains 4 target points. Between the target point 1 and the target point 2 there is a tower. Then the warrior is going to meet the target point 2, but as soon as he hits the tower, he fails to reach the target point 2 and goes to meet it until it is destroyed. The part of the code circled in pink was to be executed only after the destruction of the tower (when the life of the tower reaches 0), which does not happen, but the worst thing is that when it executes, it does not execute completely, the tower is not destroyed, but the warrior moves toward target point 2. Result in game Look that the impression occurs for the two warriors. Maybe the message log will help I decrease the delay time of the loop to 0.1 and as there is no time for the second warrior to overlap the tower along with the first warrior, everything works correctly. The problem occurs when more than one warrior reaches the tower simultaneously.


Correct use of AttachActorToActor ue4 I'm trying to stick some blocks together, but frankly I have no idea what I'm doing. I spawn 2 blocks during run time, and if they have an on hit event they're supposed to stick to each other. It struck me that I'm not even sure if that's what attach does, and maybe it has some completely different meaning. with the following blueprints, I'm getting all sorts of errors like quot already attached quot and quot can't attach actor to actor, already attached quot https imgur.com a 16Zz2eS Any help appreciated


When and how often does Epic charge me royalties on my game? I want to know about that 5 royalties that Epic charges for the Unreal Engine if I sell games above 3000. What about if my game just made 300? Do I still need to pay 5 royalties to them? And how many times should I pay? For example, I made a game that was sold for above 3000 so I paid 5 royalties but do I still need to pay it again for the same game?


Drawing roads on heightmaps I've been running into walls for the past week or so on my toy project in UE4. My goal is to draw procedural roads on a procedural landscape (eventually getting to intersections and buildings). The landscape is generated with libnoise and the roads are generated with a slightly modified version of the algorithm found here. But I'm having issues draping the roads on the landscape and I can't find any straightforward algorithmic way of doing it. You can see my problem below the geometry of the road intersects the geometry of the landscape. In short, given The landscape index buffer The landscape vertex buffer Every road segment's X,Y,Z coordinate How do I modify the underlying vertex index buffer so that the landscape "wraps around" the roads?


Real time fluid simulation? I'd like to create a system in Unreal Engine 4 with glob like fluids which interact with the environment, like the gel in Portal 2. Here's a GIF of the gel from that (search that I used to bring up similar images) I was wondering how it might be possible to do something like this? An in depth guide would be nice as I have a mostly basic understanding of blueprints in UE4, although I know it's a lot to ask for. If you know how I can achieve this, please let me know. Thank you! ) P.S The quot fluid quot stains don't need to give effects such as speed like you saw in the GIF, but I would still like the liquids to stain wherever they hit. )


Can I add extra widgets to a child widget in UMG UE4? I have a widget base class and I would like to reuse (logic and wigdets as well) it. I created an empty widget and set the parent class to the base class I would like to inherit from in the class settings. Works fine. But when I am trying to add any widget on top the pre existing ones just disappear, they get overridden by the children, I guess. I found this post for a feature request, but it is quite old. Just wondering if it is possible to add extra widgets without getting rid of the parent ones?


How to change the mesh of the character in UE4? I made a Bellsprout mesh in Blender, exported it as an FBX file, and imported it into UE4. I can insert it in the stage without problem, but I would like to use this Bellsprout mesh to replace the mesh of the built in character. Even clicking and dragging will not replace the mesh I've looked into importing between blender UE4 https wiki.unrealengine.com Static Mesh from Blender And also about mesh editing https docs.unrealengine.com en us Engine Content Types StaticMeshes Editor I also looked at some questions in this forum Changing rendering in UE4 and Making only parts of a mesh destroy in UE4 To see if the question had not already been asked.


For Visual Studio Community 2017, 'Unreal Engine Installer' option is not available On Visual Studio Community Installer, I cannot find 'Unreal Engine Installer' under 'Desktop Developemtn with C ' 'Optional'. According to the tutorials I am learning, the 'Unreal Engine Installer' should be availbl.e I have Visual Studio installed on 'C ' and Unreal installed on 'H ' can this be the problem?


How can I change the dimensions of collision volumes showed in UE4's physics asset tool? How can I change the dimensions of the capsule for one bone in the physics assets tool? The problem is that bones not connected by joints have overlapping collision volumes in the mannequin that comes with the starter content, which causes those body parts to apear dislocated or out of place when the simulation is running. For instance in this image the pelvis and the middle bone in the spine (Spine 2) are overlapping. So, when the simulation runs Pelvis and Spine 2 get pushed apart reducing the overlapping to a contact point.


Radial circle placement of meshes How to place 10 static meshes in circular pattern so they are equaly aligned from the center ?


Blueprint script executed on tick but not on construction Below, on event tick, I am initializing a map of images once, which works fine (remember we are in a graph for a widget blueprint here). Z Cursor Images is the map of the images. The keys in the map are an enum, and I am adding first an image for the default cursor, and then an image for when the player is targeting an object that she can pick up. Now, when I do the same in the construction script (Event Construct), it does not throw an error but later I cannot access the textures from the map. IsValid returns false for them... So why is the map filled on tick but not on Event Construct? And how do I solve this?


GetUserWidgetObject returns null I have a widget component inside of my character ABCharacter.h ... UPROPERTY(VisibleAnywhere, Category UI) class UWidgetComponent HPBarWidget ... ABCharacter.cpp ... AABCharacter AABCharacter() Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick true HPBarWidget CreateDefaultSubobject lt UWidgetComponent gt (TEXT("HPBARWIDGET")) HPBarWidget gt SetupAttachment(GetMesh()) I checked HPBarWidget is null and it wasn't if (HPBarWidget nullptr) UE LOG(ArenaBattle, Error, TEXT("NULL")) HOWEVER, When I try to get the widget object, it said it's null. if (HPBarWidget gt GetUserWidgetObject() nullptr) UE LOG(ArenaBattle, Error, TEXT("NULL")) it printed NULL What causes this returns null? I can clearly see I have a WidgetComponent that exists in my character's tree, and HPBarWidget wasn't null too. I struggled this already hours and couldn't find any related issues. What did I wrong? Using 4.24.3.


Unreal Engine 4 AI MoveTo always fails I try to move a character with AI MoveTo, but it always fails. I tried to do this with standart ThirdPersonController and a custom one. The blueprint is simple When the event happens, it starts printing "failed". I checked many times if I have a NavMesh on the level or any other problems with it, but I don't think there are any problems with that. Any ideas?


Make a decal a physical object? Is there a way in the UE4 to make a decal such as a blood decal and give it a physical object? I want to do it so that I can add a sound affect when the player walks on the physical object, a box trigger wont work as when the player stands on it the sound will keep playing and repeating even if the player isn't moving.


Tank turret animations I don't know if this question is more of Blender 3D or gamedev Unreal question, but I decided to ask here first. What I want to do is make a character, simple robot. The bottom part rides around on wheels, controlled by keyboard, while the top part is a turret that turns towards player cursor (which works as a crosshair). I made the model in blender, using only two bones, one for the bottom part and one for the turret. I created 4 poses for aiming each direction. Then, in Unreal, I created 2D aim offset (as I only need one dimension). And after some coding, it works... almost. When I aim forward, and then to the right, it transitions, nice. Then towards the back, also works. But if I then move to the left, instead of rotating extra 90 degrees, the turrent rotates back forward and then to the left. How can I fix it? Is there some settings in Unreal that I could use, or should I create the model in blender differently? Is the whole rig bones solution not gonna work? TLDR I want the turret on my robot to rotate infinitely to whatever I aim at.


How to create smoke that spreads outward in all directions? I saw many tutorials about smoke grenade but they just use volumetric smoke. I want to make something like the smoke grenade in PUBG, where the smoke spreads in all directions how to do that? The Unreal Engine 4 smoke grenade throws out smoke in a particular direction, like this But I want something more like PUBG's that spreads smoke evenly in all directions


Switch from left click to right click to make character walk in the Top Down Example, in UE4? When creating a new project in the Unreal Engine 4, you can choose to create a project already with some added features and things (Top Down Example) This project has a character (which I changed its appearance) and it moves around the map when I click the left mouse button I looked at the blueprints of the project, but I did not identify where the command is that makes the character walk, so I'd like it to walk when I right click. Alls blueprints of project M Cursor Decal TopDownCharacter TopDownController TopDownGameMode The circled blocks of reds are the ones I suspected could be where I should make the modification, but no information on them gave me the certainty that that was where I was supposed to change. I still do not create projects in C programming mode, because I do not have Visual Studio 2017. Some links from websites where I spent before coming here and that can help you to help me https docs.unrealengine.com en us Engine Blueprints https www.youtube.com watch?v EFXMW UEDco The video is 2015, so although it's good, I did not take it so well, because I know that with all this time that has already happened, a lot is different. Sorry for any translation errors, I'm not English speaker.


ue4editor.exe GPU selection Even though I set ue4editor.exe to use integrated graphics on my laptop, it somehow ends up using the discrete nvidia gpu is there a way to set the preferred gpu with the unreal suite?


How do you spawn a component from a class in UE4? Background I'm working on a shooter game at the moment and I'm trying to spawn an Actor Component for the weapon currently in use, in order to have less Actors to keep track of. The problem with this is that I can't easily switch out components on the fly, without making a separate function for each weapon. Question Is there currently any way to spawn a component with blueprints from a class like you would do with an Actor?


Make my Character face the same way as my Camera as I rotate the camera Before posting, I've already tried parenting the camera to the Character mesh head and setting controller yaw, that didn't work, in fact it invalidated my blueprint to set my Mouse X and Y for the pitch and yaw that allowed me to move my camera in the first place. So I need a different method to make my character follow the way my camera is facing whenever I rotate, otherwise when I turn around I just face my Character.


When and how often does Epic charge me royalties on my game? I want to know about that 5 royalties that Epic charges for the Unreal Engine if I sell games above 3000. What about if my game just made 300? Do I still need to pay 5 royalties to them? And how many times should I pay? For example, I made a game that was sold for above 3000 so I paid 5 royalties but do I still need to pay it again for the same game?


Lightmap not working? So I've been exporting and re exporting my mesh from Blender and importing it into UE4 over and over again. For some reason, even after I've generated the light map in Blender, renamed both UV maps, re applied the UV maps, baked the textures, then changed the Light Map resolution in UE4 to 512, the Light Map Coordinate to 1, and built the lighting, my mesh is still black and I can't figure out why since I've tried literally everything I could find in my research. In the image below, the left mesh is what it's supposed to look like, and the right mesh is what it looks like after building the lighting. Please help me with this, thank you.


UE4 Want my landscape to be unlit BUT catch shadows from objects Here is my problem, I have a landscape that was created through photogrametry. I already has strong shadows on it's diffuse texture so I don't want it to be affected by my virtual sun. What I do want though is for objects added in my scene to receive shadows from the landscape, and for the objects to cast shadows onto the landscape. To do that I matched my virtual sun as close as I could with the shadows on the diffuse texture of the landscape. How do I keep my landscape unlit yet able to receive and cast shadows from and to other objects?


Multiple errors on brand new C project I've just started a brand new project and created a created a new C Character class. However Visual Studio 2017 shows 140 errors. The project still builds fine, however the syntax highlighting and errors are very intrusive. Here are some examples of the errors on the BaseCharacter.cpp class I just created class "UObject" has no member "BeginPlay" class "UObject" has no member "Tick" class "UObject" has no member "SetUpPlayerInputComponent" on multiple '.h' files this declaration has no storage class or type specifier for all ' .generated.h' files cannot open source file " ClassName .generated.h" Is this a problem with my intellisence or the project itself? I haven't changed any of the code that was generated by Unreal.


UE4 Image Asset From String I have a custom widget with an image component. I want to change the image dynamically based on a string from a data table. How do I do this?


How can I add these bones to my meta human? Or is there a way I can make virtual bones count when retargetting? Paid for animations thinking they would be fine and they mostly are but... the hands are using these IK bones that I do not have. Is there a way I can add the bones to my meta skeleton within unreal? I tried creating virtual bones but they dont seem to come up in the retarget manager ( Also, I can only seem to add one virtual bone to the root whereas both the foot and hand IK root bones are parented to the root bone here. Any help would be massively appreciated!


Unreal engine project not responding to key binding changes I'm getting started with learning Unreal development, and I've created a new project based off the FPS C template. I've changed the key mappings inside the DefaultInput.ini, rebuilt the Visual Studio solution, and rebuilt the project in the Unreal editor, but none of my changes are taking effect. What step am I missing?


Problem with progress bar visibility I have a code with several elements. One of these elements I would like you to initiate hidden. So I did, set for the progress bar to start hidden. It started to go wrong when and I was calling its visibility (bind) the same stopped starting hidden. I did a test with this problematic progress bar and another one created on time The progress bar that has the visibility setting function appears even if I set it to start hidden As I said, I believe that this strange behavior is due solely and exclusively to the fact that there is such a function Even though I have created a boolean variable that imposes a condition, the bar insists on appearing The variable quoted initiates by default as false I thought the blame could be on the return knot, but as you can see in the fourth image, even putting "hidden", the progress bar appears anyway.


UE Sequencer Foot slide with character movement What is the best way to implement the character movement on the sequencer so there is no foot slide? I would go with Root Motion but the animations I have are on place. Thank you


Elements of a widget blueprint do not appear if I click on simulate I made a widget that contains 2 minimaps and 2 texts related to a character's variables. When I click the play button (Selected Viewport) everything happens fine Focus where I circled in pink. It turns out that when I click the Simulate button, these two texts do not appear, but the minimaps do I did a test by first clicking the play button (Selected Viewport) and then I ejected the character (which for me is the same thing as simulating, except without closing and opening the game) and the texts appeared, so my problem is only when I'm done start simulating. I would like to know how to make these 2 texts appear even if I click on simulate instead of play.


How can I change the dimensions of collision volumes showed in UE4's physics asset tool? How can I change the dimensions of the capsule for one bone in the physics assets tool? The problem is that bones not connected by joints have overlapping collision volumes in the mannequin that comes with the starter content, which causes those body parts to apear dislocated or out of place when the simulation is running. For instance in this image the pelvis and the middle bone in the spine (Spine 2) are overlapping. So, when the simulation runs Pelvis and Spine 2 get pushed apart reducing the overlapping to a contact point.


Unwanted blendspace bone displacement in UE4 My characters hands quot fall off quot in the blendspace between the animations. Looking for a way to fix it, if anyone has any ideas.


Unpack the pak file Unreal Engine So I have the encryption key. This is stressed so much to have it. Well, I have it. Where do I use it? Unrealpak does not seems to offer an option to supply the encryption key, if your pak is encypted the unpackaging simply fails.


Drawing roads on heightmaps I've been running into walls for the past week or so on my toy project in UE4. My goal is to draw procedural roads on a procedural landscape (eventually getting to intersections and buildings). The landscape is generated with libnoise and the roads are generated with a slightly modified version of the algorithm found here. But I'm having issues draping the roads on the landscape and I can't find any straightforward algorithmic way of doing it. You can see my problem below the geometry of the road intersects the geometry of the landscape. In short, given The landscape index buffer The landscape vertex buffer Every road segment's X,Y,Z coordinate How do I modify the underlying vertex index buffer so that the landscape "wraps around" the roads?


How to get UE4 to correctly put my bundle identifier for iOS projects? Each time I create a new project UE4 adds a generic bundle identifier to the iOS platform settings, that I always have to change to com.myname. PROJECT NAME in order to be able to run the newly created project. So, I wonder how can I make UE4 to correctly auto detect this field from the picked provisioning profile. I was thinking something like putting BUNDLE IDENTIFIER (including the square brackets) but the editor crashes when I put that in the bundle identifier field.


Unreal 4 How to access and iterate through the polygons of a mesh? I'm newbie with Unreal Engine 4. I need to create a function which calculates the volume of a mesh, based on the following example https n e r v o u s.com blog ?p 4415 To achieve that I created an actor blueprint containing a cone. I then created a function to calculate the volume of a tetrahedron composed by a polygon plus the center point of the scene, like that Now I want to iterate through each of the polygons composing the cone actor, one by one, and use the above function to calculate the total volume of the cone. I found a possible beginning for a such iteration However I'm unable to find a way to create a loop which iterate through the Triangles array and extract the 3 vertices of each triangles composing the mesh. I would be grateful if someone explained to me how to implement a such loop. Or, if so, how to access correctly to the actor mesh vertex buffer object, and to iterate through each of the polygons composing it.


Nonsense error in the overlap between 2 warriors and a tower I have a project where 1 warrior is generated every 5 seconds. This warrior as it is generated tries to follow a path that contains 4 target points. Between the target point 1 and the target point 2 there is a tower. Then the warrior is going to meet the target point 2, but as soon as he hits the tower, he fails to reach the target point 2 and goes to meet it until it is destroyed. The part of the code circled in pink was to be executed only after the destruction of the tower (when the life of the tower reaches 0), which does not happen, but the worst thing is that when it executes, it does not execute completely, the tower is not destroyed, but the warrior moves toward target point 2. Result in game Look that the impression occurs for the two warriors. Maybe the message log will help I decrease the delay time of the loop to 0.1 and as there is no time for the second warrior to overlap the tower along with the first warrior, everything works correctly. The problem occurs when more than one warrior reaches the tower simultaneously.


What does the update button in the Unreal Engine launcher actually update the engine to? Unreal Engine 4 seems to have a very handy way of managing different versions of the engine mainly you get to keep several copies and choose which one to launch. That said, not having used the new launcher recently I see that I am quite behind in engine versions but where previously I had to download the new version (as can be seen by my several copies of the engine) there is now an update button on the engines. My internet is really slow so I'm curious if anyone could tell me what the update button actually does? For example, in the circled one, will it update to some 4.2.x minor version or will it update to the 4.7.2 version that I can freshly install? If I can save some bandwidth by upgrading to 4.7.2 over downloading a fresh copy that would be ideal.


Unreal Engine 4 DefaultInput.ini mappings not showing in editor The mappings from DefaultInput.ini are not showing up in the editor. I had originally added them in the editor project settings, but it lost the mappings except for 2 of them Jump and Reset VR. They still show up in the DefaultInput.ini file. How do I get the editor to recover them (or read them from the .ini file?


Unreal Engine Ubuntu Failed to import video, unknown file extension I've been reading tutorials and guides on getting video file playback in Unreal. I have media player materials created and textures. I'm having issues importing video files to Content Movies directory. When I use the import manager the files don't show. Drag and drop says its an unknown file extension for MP4, MWV, and other formats I tried like AVI even though I know AVI is not supported. So I wonder if maybe I'm missing a plugin for Unreal 4.8 4.9 in Linux?


Map with media texture not packaging I have a simple map with a Big sphere and a pawn inside it. I use media texture and media player to play 360 video on it. But when I try to package it for windows 64 it fails while it tries to cook the map. Yes all the videos are copied to Content Movies first and then imported to UEProject as asset later. This is very crucial to our project. One of our developer have already started to build the solution in Unity just in case if packaging issue does not resolve with media player in unreal. Please help!


How to support importing .uasset files in game for content creators(UE4)? I would like to support importing clothes(as SkeletalMeshes) and props(as StaticMeshes) as uasset files into game for content creators, which obviously have not been packaged with the game. Basically I am looking for a clean modding pipeline. EDIT TLDR Is it possible to load .uasset files with StaticLoadObject() into game and use assets from it after the game has been packaged? Or does it only work with packaged files? If not what function do you recommend for that purpose? not TLDR Bringing in stuff does work well in the editor, using Rama's LoadObjectFromAssetPath, just by right clicking my asset in Content Browser copy reference and copy pasting the result to the path variable of the LoadObjectFromAssetPath blueprint node. Well, I am not sure if it is going to work at runtime... So I used my favourite search engine and put in some keywords and bumped into this. Then I wrote some code(Blueprint Function Library) void UFileDialogOpener LoadFile(FString from) auto result StaticLoadObject(UStaticMesh StaticClass(), NULL, from) GEngine gt AddOnScreenDebugMessage( 1, 150.0f, FColor Red, quot from quot from) if(result)GEngine gt AddOnScreenDebugMessage( 1, 150.0f, FColor Green, quot name quot result gt GetName()) else GEngine gt AddOnScreenDebugMessage( 1, 150.0f, FColor Green, quot no result quot ) auto meSkelMesh Cast lt UStaticMesh gt (result) if(meSkelMesh)GEngine gt AddOnScreenDebugMessage( 1, 150.0f, FColor Red, meSkelMesh gt GetName()) else GEngine gt AddOnScreenDebugMessage( 1, 150.0f, FColor Red, quot no mesh quot ) As per the debug messages StaticLoadObject does not find anything. I tried feeding it the both of the results of righclicking my asset in Content Browser and choosing either copy reference and copy path. Neither of them yielded any result. Not sure where I am messing up. Anyways, just wondering if anyone can recommend a better way of doing this(code, plugins etc)?


Create a instance of a C class within a blueprint I'd like to create an instance of a C class in a blueprint. That's my current approach, but the instance is None. Why?


How to create smoke that spreads outward in all directions? I saw many tutorials about smoke grenade but they just use volumetric smoke. I want to make something like the smoke grenade in PUBG, where the smoke spreads in all directions how to do that? The Unreal Engine 4 smoke grenade throws out smoke in a particular direction, like this But I want something more like PUBG's that spreads smoke evenly in all directions


Display a variable in the UI I have been searching and searching for an answer to this question but nobody seems to be helping me. I have wasted the past two hours trying to figure out how to do this, so please help me out here. I am making a FPS game in Unreal Engine 4, and I want to display ammo. I can do that fine, but changing the text of the UI displaying the ammo is turning into a nightmare. I need to access the text label variable Inside of the blueprint that handles the actual gun firing From there I should be able to adjust the text to match what my ammo is. Unfortunately, no matter what I try, I cannot change the variable in my blueprint. I can't even make the variable public to begin with! What do I need to do to accomplish this?


Creating a GUI Countdown Timer Unity5 This was originally posted as a follow up comment to https stackoverflow.com questions 30714357 guitext in unity 5 need an alternative , but I'm asking it here as a dedicated question as per the community's recommendation. What I'm trying to do display GUI Text on screen as a countdown timer that counts down in real time What I've done so far watched YouTube tutorial "Unity Scripting Tutorial 7 A Countdown Timer" by VR Enthusiast.1 GameObject UI Text renamed TimerText Wrote the Timer script in C using UnityEngine using UnityEngine.UI using System.Collections public class Timer MonoBehaviour public float seconds 59 public float minutes 0 void Update() if (seconds lt 0) seconds 59 if (minutes gt 1) minutes else minutes 0 seconds 0 GameObject.GetComponent lt GUIText gt ().text minutes.ToString("f0") " 0" seconds.ToString("f0") else seconds Time.deltaTime if(Mathf.Round(seconds) lt 9) GameObject.GetComponent lt GUIText gt ().text minutes.ToString("f0") " 0" seconds.ToString("f0") else GameObject.GetComponent lt GUIText gt ().text minutes.ToString("f0") " " seconds.ToString("f0") placed the TimerText object in the GUI Text object reference Then I got this error "MissingComponentException There is no 'GUIText' attached to the "TimerText" game object, but a script is trying to access it. You probably need to add a GUIText to the game object "TimerText". Or your script needs to check if the component is attached before using it. Timer.Update () (at Assets Timer.cs 40)" I essentially placed The object GUI Text object itself (TimerText) as its own scripting reference in Unity's Inspector. Not sure where to go from here. Any advice on what I can do next? Any help would be appreciated.


CenterContainer makes my button too small I get the perfect width for my buttons, but CenterContainer overrides that value of theirs to make the button as wide as the biggest text length of the buttons when I put the buttons inside of the container godot 3.1


How to make a scrollbar? I am making my own UI for my game, no libraries used, basic UI with simple controls and I am almost done. Now, let's say I need to display lots of information, controls or items which obviously won't fit in the screen space. I must use a scroll bar to achieve this task. But how does one make a scroll bar? I just don't understand how to do it. The concept for vertical and horizontal scrollbars is the same. Virtually there is a huge plain with data, but we can only display cut of it all in a such by such screen space. We use scrollbars to move that viewable rectangle across our giant plain. The scrollbar itself is a displayed line texture sprite on the side of the screen which has a button inside that we can interact with by moving it across the scrollbar. The button is dynamic, its size is relative to total item count and possible item count that can be shown in given space. Our button shrinks when there are more items added, expands when items are getting removed and the whole scrollbar disappears when all the items can be successfully displayed at once. I can't seem to find online tutorials on this matter. Perhaps it's so basic for everyone except me? Still can't wrap my head around it...


Application toolkits like QT versus traditional game multimedia libraries like SFML I currently intend to use SFML for my next game project. I'll need a substantial GUI though (RPG strategy type) so I'll either have to implement my own or try to find an appropriate third party library, which seem to boil down to CEGUI, libRocket, and GWEN. At the same time, I do not anticipate doing that many advanced graphical effects. My game will be 2D and primarily sprite based with some sprite animations. I've recently discovered that QT applications can have their appearance styled so that they don't have to look like plain OS apps. Given that, I am beginning to consider QT a valid alternative to SFML. I wouldn't have to implement the GUI functionality I'd need, and I may not be taking advantage of SFML's lower level access anyway. The only drawbacks I can think of immediately are the learning curve for QT and figuring out how to fit game logic inside such a framework after getting used to the input update render loop of traditional game libraries. When would an application toolkit like QT be more appropriate for a game than a traditional game or multimedia library like SFML?


Can't change anchor position and TextureRect size I'm making UI, and want to set anchor to middle of the image, but changing anchor from Layout Anchors Only or setting Anchor value directly doesn't work. The value was updated, but anchor point not moved at all. Is it bug or is there are something that I missed? Here's the node tree CanvasLayer Control TextureRect lt Anchor is not moving at all Using Godot 3.1.1. Also I can't find how to resize texture rect. I can set the min size, but change size doesn't work, the value immediately set back to original size. How to change the texture rect size?


Logic only GUI library I'm not sure whether this place is the correct for asking this. If it's the wrong place I'm sorry, please tell me if so! I'm making a small game for fun which would uses an own engine with OpenGL and Vulkan as underlying renderer implementation. The engine itself is targeted for Mono .Net. Currently I'm not yet there but I'll come to the point where I'm pushed to implement some kind of GUI (I'm thinking ahead because of good design). I already searched the Internet for render independent GUI systems but I wasn't lucky yet. As result I thought about how I could implement the GUI on my own and came to the conclusion a independent implementation is needed which takes care only for layout, positioning of GUI objects with responding to inputs. another implementation is needed which only takes the results of calculations for rendering (the renderer) Before I start inventing the whole wheel new I simply want to know Is it a correct approach to doing it this way? Is there a different common approach doing what I described?


How can I model a "weapon overheating" mechanic? I want to create a weapon overheating system very similar to the plasma rifle in Halo. You can watch a video of the plasma rifle firing. What I want to do is to create a flexible logic that can be used for multiple weapons for different in game feelings. Here is my proposed system Create a bar that is split from 0 100. Each bullet has a heat value as an integer. Every bullet adds this value to the bar. The bar has a cooldown set as some value per second. If the bar goes over 100 with any bullet fire the bullet still shoots but then the weapon is deactivated for a period defined as it's "cooldown." Now this system is very simple but visually it will be very linear, with a simple growth and decay. I wanted to try to create a more exponential system that would mean the bar would jump quickly to the middle then remain and hover near the top hot bit of the bar for a long period to create a sense of anticipation just before it overheats. What would be a good formula to achieve that result?


How do I render my own DirectX Stuff to a full screen WPF's DirectX surface? Basically Danny Varod seems to know as he posted it as an answer to this question Display a Message Box over a Full Screen DirectX application I think, theoretically this might work, but I have no idea how to actually do it. Since I'm also not allowed to post a comment under his comment nor am I allwoed to ask on meta about how to contact another user, I ask this as a normal question here How do I render my own DirectX Stuff to a full screen WPF's DirectX surface? For starters, I have no idea how to get the DirectX surface from a WPF window. If I had it, what do I have to take care of that the WPF rendering doesn't screw up my own rending or vice versa?


Nifty popup fails to register I'm new to Nifty GUI, so I'm following a tutorial here for making popups. For now, I'm just trying to get a very basic "test" popup to show, but I get multiple errors and none of them make much sense. To show a popup, I believe it is necessary to first have a Nifty Screen already showing, which I do. So here is the ScreenController for the working Nifty Screen public class WorkingScreen extends AbstractAppState implements ScreenController Main is my jme SimpleApplication private Main app private Nifty nifty private Screen screen public WorkingScreen() public void equip(String slotstr) int slot Integer.valueOf(slotstr) System.out.println("Equipping item in slot " slot) Here's where it STOPS working. app.getPlayer().registerPopupScreen(nifty) System.out.println("Registered new popup") Element ele nifty.createPopup(app.getPlayer().POPUP) System.out.println("popup is " ele) nifty.showPopup(nifty.getCurrentScreen(), ele.getId(), null) Override public void initialize(AppStateManager stateManager, Application app) super.initialize(stateManager, app) this.app (Main)app Override public void update(float tpf) jME update loop! public void bind(Nifty nifty, Screen screen) this.nifty nifty this.screen screen When I call equip(0) the system prints Equipping item in slot 0, then a lot of errors and none of the subsequent println()'s. Clearly it botches somewhere in Player.registerPopupScreen(Nifty nifty). Here's the method public final String POPUP "Test Popup" public void registerPopupScreen(Nifty nifty) System.out.println("Attempting new popup") PopupBuilder b new PopupBuilder(POPUP) childLayoutCenter() backgroundColor(" 000a") panel(new PanelBuilder() id("List") childLayoutCenter() height(percentage(75)) width(percentage(50)) control(new ButtonBuilder("TestButton") label("TestButton") width("120px") height("40px") align(Align.Center) ) ) System.out.println("PopupBuilder success.") b.registerPopup(nifty) System.out.println("Registerpopup success.") Because that first println() doesn't show, it looks like this method isn't even called at all! Edit After removing all calls on the Player object, the popup works. It seems I'm not "allowed" to access the player from the ScreenController. Unfortunate, since I need information on the player for the popup. Is there a workaround?


What method is best to display respawn times? I'm currently working on multiplayer game and am trying to work out how to display respawn times. I had a few ideas in mind, taking inspiration from other games I've played before. Text Based Progress Bar Visual Timer Is there another way to display respawning for players that improves visual feedback? Meaning, is clear and effective at conveying exactly how long a player has to wait to respawn?


How do I attach UI data to logic data? I'm attempting to write an inventory system(C , doesn't need to be huge), that later on should be able to be drawn in a GUI. In the file structure, I think it would be best to put both information about the item itself and references to graphics, etc. in one file. But how does that translate into code? How should I tell the renderer, for example which sprite to draw for which item and where to do that. Should I only have the CInventory and the CItem class, containing both logic and sprite information, or should I create separate logic and GUI inventory(in this case meaning both CInventory and CItem) classes which are then linked by a common item id for example? Answers are always appreciated )