_id
int64 0
49
| text
stringlengths 71
4.19k
|
---|---|
40 | Why isn't my cbuffer updating? I am really frustrated because my cbufer isn't updating. This is my VS cbuffer MatrixBuffer register(b0) float4x4 worldViewProj struct VertexIn float4 Pos POSITION float4 Color COLOR struct PixelIn float4 PosH SV POSITION float4 Color COLOR PixelIn VS (VertexIn vin) PixelIn vout vin.Pos.w 1.0f vout.PosH mul(vin.Pos, worldViewProj) vout.Color vin.Color return vout PixelIn VS1(VertexIn vin) PixelIn vout vin.Pos.w 1.0f vout.PosH vin.Pos vout.Color vin.Color return vout When using VS1 it draws correctly, but when using VS it doesn't draw anything? Here is my CBUFFER update code bool Game UpdateShaders() HRESULT result D3D11 MAPPED SUBRESOURCE mappedResource MatrixBufferType dataPtr worldViewProjM worldM viewM projM worldViewProjM XMMatrixTranspose(worldViewProjM) result md3dDeviceContext gt Map(mMatrixBuffer, 0, D3D11 MAP WRITE DISCARD, 0, amp mappedResource) if (FAILED(result)) MessageBoxW(mMainWnd, L"FAOE ", 0, 0) return false dataPtr (MatrixBufferType )mappedResource.pData dataPtr gt worldViewProj worldViewProjM md3dDeviceContext gt Unmap(mMatrixBuffer, 0) int NBuffers 0 md3dDeviceContext gt VSSetConstantBuffers(0, 1, amp mMatrixBuffer) md3dDeviceContext gt PSSetConstantBuffers(0, 1, amp mMatrixBuffer) return true Here is my MATRIXBUFFERTYPE struct struct MatrixBufferType XMMATRIX worldViewProj This is called after I clear my depth stencil view and render target view. Does somebody know why my CBUFFER isn't updating? Thanks in advance. |
40 | 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. |
40 | Frame timer does not show time I am currently using DirectX11 and MFC. The top of the window should tell me how long it takes to render the cube (in seconds). At the moment the cube is rendered but when I try to work out how many seconds it took to render the cube I keep getting 0 on the top of the window. This cannot be right. Help please? This is my Ondraw function void CLearningVisualCView OnDraw(CDC pDC) I want the OnDraw function to create the cube.. CString TimerReports TODO add draw code for native data here CLearningVisualCDoc pDoc GetDocument() ASSERT VALID(pDoc) if (!pDoc) return Timer.GetStartTime() Render() This renders the cube Timer.GetEndTime() The counts stopwatch ends. Timer.DeltaCountDifference(Timer.StartTime, Timer.EndTime) Timer.GetSecondsPerCount() Timer.FrameTime(Timer.DeltaCounts, Timer.SecondsPerCount) TimerReports.Format( T(" .100I64d"), Timer.Time) TimerReports.Format( T(" .5I64d"), Timer.FrameTime(Timer.DeltaCounts, Timer.SecondsPerCount)) This converts the DeltaCountDifference into a CString. It has 5 d.p. AfxGetMainWnd() gt SetWindowText(TimerReports) This displays my count difference to the top of the window. This is my Timer class include "stdafx.h" include "GameTimer.h" GameTimer GameTimer() QueryPerformanceFrequency((LARGE INTEGER ) amp countsPerSec) SecondsPerCount 1.0 (double)countsPerSec GameTimer GameTimer() int64 GameTimer GetStartTime() QueryPerformanceCounter((LARGE INTEGER ) amp StartTime) return StartTime int64 GameTimer GetEndTime() QueryPerformanceCounter((LARGE INTEGER ) amp EndTime) return EndTime The int64 amp are references. We will link them to the StartTime and the EndTime in the CLearningVisualCView OnDraw(). This is done by adding them as arguments. int64 GameTimer DeltaCountDifference( int64 amp TimeA, int64 amp TimeB) int64 DeltaCounts TimeB TimeA return DeltaCounts float GameTimer GetSecondsPerCount() QueryPerformanceFrequency((LARGE INTEGER ) amp CountsPerSecond) SecondsPerCount 1 CountsPerSecond return SecondsPerCount int64 GameTimer FrameTime( int64 amp TheDeltaCounts, float amp SecsPerCount) Time TheDeltaCounts SecsPerCount return Time |
40 | Unused constant buffers in shaders If you define a constant buffer in a shader, for example cbuffer test register(c2) float4x4 data But never actually use the data in the shader, does that incur any runtime cost at all? It's convenient for me to do this but not at the cost of slowing runtime performance at all. When I time it I don't see any difference... |
40 | Texture coordinate into texel form? How do I convert a texture coordinate, like 1,0 into a texel form(a single value?). Like in the image below, what is the value of Q22 in texel? I'm in directx 11. |
40 | How do I deal with timeout detection and recovery in D3D? What is exactly measured when checking TDR in Windows? What do I need to do in my D3D11 app to tell TDR that long rendering is okay? I've already split the workload into smaller batches, but how do I tell TDR when this batch begins and when it ends? I know that IDXGISwapChain Present method will do this for me, but is it the only way? Is ID3D11DeviceContext Flush method doing the same thing? |
40 | Depth Stencil buffer mandatory? If I disable depth and stencil buffering, do I have to create and set the depth stencil buffer? |
40 | Full screen quad in the HLSL Directx 11 I want to create a full screen Triangle Quad so I can blur the box that is the quad I made. I want to do this in the vertex buffer. I tried this code struct VSQuadOut float4 position SV POSITION float2 uv TEXCOORD outputs a full screen triangle with screen space coordinates input three empty vertices VSQuadOut VSQuad( uint vertexID SV VertexID ) VSQuadOut result result.uv float2((vertexID lt lt 1) amp 2, vertexID amp 2) result.position float4(result.uv float2(2.0f, 2.0f) float2( 1.0f, 1.0f), 0.0f, 1.0f) return result I want something like this Any ideas? |
40 | Rendering to specific face of a cubemap I have working omnidirectional shadow maps for point lights. Rendering a shadow map for one point light consists of rendering the scene to 6 separate rendertargets, then send those render target textures (shaderresourceviews) to a pixel shader which will shadow the scene by projective texturing. Switching rendertargets 6 times for each point light however is quite costly, and so does sampling from those in the pixel shader later. My question is how would I access a face of the cubemap to render to? Now I am doing Id3d11devicecontext omsetrendertargets(1,NULL, amp depthtarget) . My depthtarget is a texture2d which is bound to a depthstencil view and a shaderresource which is set up to be a cubemap. Can I even set an individual face to render to or is the process completely different? |
40 | How to create a native windows menu ribbon for a DirectX 11 app I need to create menu items on top of my DX11 windowed app similar to most windowed applications (File, Edit, etc...). How can I achieve this ? There is a hMenu handle to pass to the DirectX window creation function but I have no idea how to create this object. Additionnaly I'd like to have 1 or several ribbons under the window menu with icons to trigger functionnality. EDIT My menu is all good now and I chose to implement a windows ribbon, but I'm still having problems at creating the ribbon. Here is a screenshot of my app. The green color is the Direct3D clear color I would like my ribbon to display under the menu (and eventually remove the menu after that). My ribbon code being LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) PAINTSTRUCT paintStruct HDC hDC switch (message) case WM CREATE if (!SetupMenus(hwnd)) MessageBox(nullptr, TEXT("Failed to setup GUI."), TEXT("Error"), MB OK) ... bool SetupMenus(HWND hwnd) Create the menu ... Create the ribbon IUIFramework pFramework NULL HRESULT hr CoCreateInstance(CLSID UIRibbonFramework, NULL, CLSCTX INPROC SERVER, IID PPV ARGS( amp pFramework)) if (FAILED(hr)) std cerr lt lt "Fail 1" lt lt std endl hr pFramework gt Initialize(hwnd, IUIApp) if (FAILED(hr)) std cerr lt lt "Fail 2" lt lt std endl outputs Fail 1. Why can't I create the ribbon ? |
40 | How do I use threads together with DirectX11? I have only found the documents on MSDN http msdn.microsoft.com en us library windows desktop ff476884(v vs.85).aspx Although it doesn't say anything about creating them, it mentions that device is thread safe while device context is not. Does the framework use threads by itself (if driver supports it) when it thinks it's more optimal? Or do we have to use some external library like BOOST to play around with threads? |
40 | Update DXGI swapchain sample count without recreating swapchain in full screen mode I'm implementing the ability to tweak graphics settings in my application at runtime (resolution, refresh rate, v sync, multisampling). It is possible to update the resolution, format and refresh rate using IDXGISwapChain ResizeTarget and IDXGISwapChain ResizeBuffers. However, I cannot find any way to update the swapchain's sampling(count and quality) in the same way. The only option I have is to go to windowed mode using IDXGISwapChain SetFullscreenState, then release the swapchain, recreate the swapchain with a new DXGI SWAP CHAIN DESC, and then go back to fullscreen again. (Didn't mention releasing and recreating back buffer and depth stencil since it is a must do).I am willing to stay at full screen mode before and after the settings are applied. |
40 | ID3D11Device CreateInputLayout Encoded Signature size doesn't match specified size I get STATE CREATION ERROR 161 CREATEINPUTLAYOUT UNPARSEABLEINPUTSIGNATURE with the following code Vertex data struct VertexData XMFLOAT3 v XMFLOAT2 vt XMFLOAT3 vn ... Create the input layout vertex shader. D3D11 INPUT ELEMENT DESC vertexLayoutDesc "V", 0, DXGI FORMAT R32G32B32 FLOAT, 0, offsetof(VertexData, v), D3D11 INPUT PER VERTEX DATA, 0 , "VT", 0, DXGI FORMAT R32G32 FLOAT, 0, offsetof(VertexData, vt), D3D11 INPUT PER VERTEX DATA, 0 , "VN", 0, DXGI FORMAT R32G32B32 FLOAT, 0, offsetof(VertexData, vn), D3D11 INPUT PER VERTEX DATA, 0 HRESULT hr g d3dDevice gt CreateInputLayout(vertexLayoutDesc, countof(vertexLayoutDesc), geomVertexShaderBlob gt GetBufferPointer(), geomPixelShaderBlob gt GetBufferSize(), amp g d3dInputLayout) And wannabe matching HLSL code struct Input float3 v V float2 vt VT float3 vn VN struct Output float4 color COLOR float4 position SV POSITION Output main(Input input) ... I can't spot the mismatch and what exactly the error message is pointing to. Weird thing I have very similar input layout and shaders that work perfectly fine, but this one doesn't. |
40 | DirectX 11 Mouse Picking Problem I'm trying to do mouse picking and actually it works but when I scale the object and click that point on the image it picks wrong one, this happens only after scaling an object and I'm sure matrices are correct, any idea? DirectX XMFLOAT4X4 projection DirectX XMStoreFloat4x4( amp projection, Graphics projectionMatrix) float viewX ((2.0f Input GetMouseX()) MainWindow GetDisplayResolution().width 1.0f) projection(0,0) float viewY (1.0f (2.0f Input GetMouseY()) MainWindow GetDisplayResolution().height) projection(1,1) DirectX XMMATRIX inverseMV DirectX XMMatrixInverse(nullptr,DirectX XMMatrixTranspose(entity gt Renderer gt MV Matrix)) MV is column order DirectX XMVECTOR rayOrigin DirectX XMVector3TransformCoord(DirectX XMVectorSet(0.0f,0.0f,0.0f,1.0f), inverseMV) DirectX XMVECTOR rayDirection DirectX XMVector3Normalize(DirectX XMVector3TransformNormal(DirectX XMVectorSet(viewX, viewY, 1.0f, 0.0f), inverseMV)) for (const auto amp subMesh entity gt Renderer gt mesh gt GetSubMeshes()) float distance 0.0f if (subMesh.AABB.Intersects(rayOrigin, rayDirection, distance)) for (unsigned int i 0 i lt subMesh.GetIndexCount() i 3) DirectX XMVECTOR p1 DirectX XMLoadFloat3( amp subMesh.positions subMesh.indices i ) DirectX XMVECTOR p2 DirectX XMLoadFloat3( amp subMesh.positions subMesh.indices i 1 ) DirectX XMVECTOR p3 DirectX XMLoadFloat3( amp subMesh.positions subMesh.indices i 2 ) if (DirectX TriangleTests Intersects(rayOrigin, rayDirection, p1, p2, p3, distance) amp amp distance lt minDistance) minDistance distance pickedEntity entity |
40 | Can state setting warnings be ignored? If I am running DirectX 11 in debug mode (D3D11 CREATE DEVICE DEBUG), I am constantly getting these warnings D3D11 WARNING ID3D11DeviceContext OMSetRenderTargets Resource being set to OM DepthStencil is still bound on input! STATE SETTING WARNING 9 DEVICE OMSETRENDERTARGETS HAZARD D3D11 WARNING ID3D11DeviceContext OMSetRenderTargets AndUnorderedAccessViews Forcing PS shader resource slot 6 to NULL. STATE SETTING WARNING 7 DEVICE PSSETSHADERRESOURCES HAZARD It is because I am setting a resource as a render target while it is currently bound to the PS. However, my rendering flow is set up such as it relies on the api to force the resource slot to null, and it works. Is there any reason I should be bothered with these warnings or I can rely on the api to enforce this every time? I only tested on 2 GPU s Intel HD 3000 and Nvidia GT525m. |
40 | Making a parenting system Each Entity can have one parent and any number of children. They have a position vector and a quaternion orientation. I know that I can make objects look like they're in a hierarchy by multiplying parent transforms all the way to the root, but how to I get the canonical coordinates out of those transformations? I need to have the real position of every Entity in the world in order to update their bounding meshes. I would like to keep my drawing code for everything as just this XMMATRIX transform XMMatrixRotationQuaternion(orientation) transform XMMatrixMultiply(transform, XMMatrixTranslation(position)) transform XMMatrixMultiply(world, transform) model gt Draw(context, states, transform, view, projection) Eg. without relying on visual tricks to get the hierarchy looking right, so no multiplications with parent transforms while rendering. How do I properly change a child's position and orientation with respect to the parent? |
40 | HLSL Shader Optimilation with MAD(m,a,d) I understand that the expression x m a d is most efficiently written as x mad(m,a,d) because at the assembly level only one instruction is needed rather than a multiply and add separately. My question regards optimally writing this expression x m a. Should this be written as x mad(m,a,x) or x m a? The difference is too subtle to profile but I'm wondering if anyone can see the difference at the assembly level. (I don't know how to view the assembly code.) |
40 | Making a parenting system Each Entity can have one parent and any number of children. They have a position vector and a quaternion orientation. I know that I can make objects look like they're in a hierarchy by multiplying parent transforms all the way to the root, but how to I get the canonical coordinates out of those transformations? I need to have the real position of every Entity in the world in order to update their bounding meshes. I would like to keep my drawing code for everything as just this XMMATRIX transform XMMatrixRotationQuaternion(orientation) transform XMMatrixMultiply(transform, XMMatrixTranslation(position)) transform XMMatrixMultiply(world, transform) model gt Draw(context, states, transform, view, projection) Eg. without relying on visual tricks to get the hierarchy looking right, so no multiplications with parent transforms while rendering. How do I properly change a child's position and orientation with respect to the parent? |
41 | How can I calculate DeltaTime in seconds? Here is how I've been trying to implement delta time based on different internet resources. var startTime Number getTimer() game.Update(deltaTime) deltaTime Number(getTimer() startTime) 0.001 My issue with this is it doesn't seem to be giving me accurate timing. The main update shows the frame time at 0.001 and when reinitializing the level it goes to 0.002. I'm using dt else where for a timer and later on time based physics so I would like it to work as expected. I must be missing something silly. |
41 | 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. |
41 | 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? |
41 | 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. |
41 | Best practice for organizing storing character monster data in an RPG? Synopsis Attempting to build a cross platform RPG app in Adobe Flash Builder and am trying to figure out the best class hierarchy and the best way to store the static data used to build each of the individual "hero" and "monster" types. My programming experience, particularly in AS3, is embarrassingly small. My ultra alpha method is to include a " class" object in the constructor for each instance. The class, in turn, is a static Object pulled from a class created specifically for that purpose, so things look something like this Character.as package public class Character extends Sprite public var strength int etc. public function Character( class Object) strength class. strength etc. MonsterClasses.as package public final class MonsterClasses extends Object public static const Monster1 Object strength 50, etc. etc. Some other class in which characters monsters are created. Create a new instance of Character var myMonster new Character(MonsterClasses.Monster1) Another option I've toyed with is the idea of making each character class monster type its own subclass of Character, but I'm not sure if it would be efficient or even make sense considering that these classes would only be used to store variables and would add no new methods. On the other hand, it would make creating instances as simple as var myMonster new Monster1 and potentially cut down on the overhead of having to read a class containing the data for, at a conservative preliminary estimate, over 150 monsters just to fish out the one monster I want (assuming, and I really have no idea, that such a thing might cause any kind of slowdown in execution). But long story short, I want a system that's both efficient at compile time and easy to work with during coding. Should I stick with what I've got or try a different method? As a subquestion, I'm also assuming here that the best way to store data that will be bundled with the final game and not read externally is simply to declare everything in AS3. Seems to me that if I used, say, XML or JSON I'd have to use the associated AS3 classes and methods to pull in the data, parse it, and convert it to AS3 object(s) anyway, so it would be inefficient. Right? |
41 | Bullet Manager Class I'm making a game in AS3, and it's a rather simple shooting game because I'm original. Anyway, probably the most subjective question here yet what is the best way to implement bullets in my game? Would it be smarter to make a universal bullet manager class on the game that handles all the bullet related data or have every entity that has bullets (players, enemies) have this sort of 'bullet manager'? Make a level wide bullet manager or bullet manager for each entity? Oh, and a side question I actually have an enemy manager class. How would I check for collisions from the aforementioned bullet manager class. |
41 | how to draw a dashed curved line to a point in as3? How can I draw a dashed curved line to a x,y point in as3? Basically I'm creating a game where you have a turret, and I want the arc the turret would fire a projectile along to be displayed as a dashed dotted line along the arc to wherever the mouse x,y is. Ideally it would use the drawing API, rather than using any bitmap manipulation. |
41 | 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 |
41 | 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. |
41 | 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... |
41 | Drawing simulator Tracking mouse movement I was wondering what would be the logic behind coding a drawing simulator like the one on this website https www.mdbg.net chindict chindict.php?page chardict amp cdcanoce 0 amp cdqchi The paintbrush tool when you click it, once you start drawing strokes that a similar to what a character is, it will automatically bring out a list of characters that leads toward what you are drawing. Once you are finished, the correct character will show up. To my idea, I think that a set of coordinates are set already and once the mouse coordinates passes through these points, then from there it will detect and provide all the possibilities and narrows it even further. I think this is very complex but what would be the right path correct way to go about programming this concept? |
41 | 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). |
41 | 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 |
41 | Drawing simulator Tracking mouse movement I was wondering what would be the logic behind coding a drawing simulator like the one on this website https www.mdbg.net chindict chindict.php?page chardict amp cdcanoce 0 amp cdqchi The paintbrush tool when you click it, once you start drawing strokes that a similar to what a character is, it will automatically bring out a list of characters that leads toward what you are drawing. Once you are finished, the correct character will show up. To my idea, I think that a set of coordinates are set already and once the mouse coordinates passes through these points, then from there it will detect and provide all the possibilities and narrows it even further. I think this is very complex but what would be the right path correct way to go about programming this concept? |
41 | Looking for a good actionscript 3 book I've been looking for a book on actionscript3 development, but while there's tons of books out there, nobody seems to want to recommend any specific one. One book I've been pointed towards is the cookbook by o'reilly, but it, like most books out there, seems to be based on the assumption that I'm using flexbuilder or flash. Instead, I'm "just" using flashdevelop, or the free SDK directly. I've also been told to just go with the api reference and live with it. I could do that, I suppose, but I'd rather have a book that gives me the big picture. Kind of like with cocoa, there's the hillegrass' book, or the red book of OpenGL. So, what would be the actionscript3 book out there? |
41 | Blitting in AS3 with anti aliasing? What would be the fastest method for doing anti aliasing for a flash game that is drawn via blitting to a BitmapObject? A method I thought of would be to make games stage smaller than the BitmapObject that the game is drawn to, and then somehow shrink it to the size of the stage. Would that method work? If so what would be the fastest and highest quality to shrink the bitmap? Or would there be a completely different way to do it? |
41 | 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. |
41 | Nape physics Moving a body Hey I'm currently getting started with physics engines and I set up a body (box shaped) which represents my character. Question Which methods can I use to move a Nape.Body aka my char? I tried so far to manipulate the velocity, addLocalForce Impulse but I don't know which method is the best for moving a character. |
41 | 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 |
41 | 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! |
41 | 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? |
41 | 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. |
41 | 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. |
41 | 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? |
41 | 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? |
42 | How to change Alt Drag and Shift Drag shortcut in Unreal Engine? As a 3DS Max user, the ALT SHIFT commands are reversed in Unreal, and for the life of me, I cannot easily switch between these differences. I always try to copy an asset by Shift Click Dragging it, and end up panning with it instead. The alt key is supposed to deselect, and instead it duplicates in Unreal. I've looked everywhere in the General Keyboard Shortcut settings and don't see those keybinds. |
42 | In unreal engine, what's the difference among "set global time dilation" and "set current time dilation" and "set custom time dilation"? what's the different effect of these three functions, thanks! |
42 | How to change the value of variable from actor Y by the blueprint of actor X? I have a project, and it has 1 NPC (actor X), 2 target points and 1 tower (actor Y). Image of components in level These rose arrows demonstrate part of the NPCs path. I added a Event Begin Overlap in the blueprint of the NPC so that when it collides with the tower it loses 10 of life every second Image of print of variable life When the NPC gets 0 life, it goes to the next target point. But I would like to know how to also modify the life of the tower by the same blueprint (NPC). The code is already in my mind, it is kind of obvious to speak the truth. "Code" of NPC blueprint I do not want to have to create a new Event Begin Overlap on the blueprint of the tower. And I think using the blueprint level would not be a good idea. One of the links below indicated something like Blueprint Interface, but I'd like to know if I can do what I want for the NPCs own blueprint. Links https forums.unrealengine.com international brazil 89438 pegar vari C3 A1vel de outro blueprint https answers.unrealengine.com questions 21386 communication between 2 blueprints.html?sort oldest https answers.unrealengine.com questions 24773 how to call a blueprint variable from another blue.html https docs.unrealengine.com en us Engine Blueprints UserGuide Types Interface |
42 | How can I fix texture clipping in Unreal 4? I made a small project testing out mini maps, it worked fine, I left it alone for a few months and reopened the project, and now I'm getting this I'm not even sure what to call this kind of issue other than clipping. Also note, a sprite representing the player model is supposed to be at the center of the mini map, but now it doesn't show. I hadn't made any changes to the project since I last worked on it, and when I check the camera I'm using for the mini map, the pointer is definitely visible in the Blueprint. The project was made in 4.13. Though as I took that screenshot, everything else that should be visible disappeared, so the mini map no longer is showing the floors and walls. This feels like a graphics problem. Anyone know where I can start fixing this? SOLVED It was a rendering shader problem. Project settings platform mac rendering Max Metal Shader Standard to Target "Metal v1.1" |
42 | 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? |
42 | Read actor instance's text variable for widget when triggered on different objects What I'm trying to do (a 'long story version' is linked in comment below) (and another user example is hyperlinked in comment below i couldn't post over 8 images and or links in this first comment ) (there are other similar user questions elsewhere I know) Short story I'm trying to make a widget that is triggered by an actor blueprint, and I want the widget to display different text that reflects the public variable text edits I make in the editor. My latest progress includes actors that are titled somewhat according to the hyperlinked user case above so, I have a quot door trigger quot and a quot doorWidget quot . I have altered the pin connections so much that I am just going to copy and paste all my screen shots below. I got to change text asset DoorName by making a public variable called quot name, quot as you'll see. I can make the trigger show this text on screen and have it disappear when the user leaves the trigger actor, BUT EVERY INSTANCE ALSO SHOWS THIS TEXT VALUE, EVEN THOUGH I CHANGE IT In the screenshots (some in comment following too) you'll see the text quot 3 quot appear on screen, and it does this for all three of the dummy boxes I made notice how the second box is supposed to show quot dd quot (I was just typing random filler content). ALL HELP SO APPRECIATED!!!!! Thank you!!! |
42 | Cannot add key in matinee for static meshes (UE4) My problem is the following I was trying to make a sliding door based on a video tutorial, I had the static mesh, which was the door itself, and I added a Matinee for that door, so I went 'Add New Empty Group Add Movement Track', so I had the door with a movement track, but when I tried to add a key, I couldn't. This was the error message "Nothing to keyframe, or selected object can't be keyframed on this type of track." And I only get this message when I try to add keys in the movement track of a static mesh. When it's a camera, everything is fine. Any idea why this is happening, and how I can solve this? Thanks for your help |
42 | How to convert Unreal Engine 4 spline to a bezier curve? I have read the source code of USplineComponent and found that for a curve in Unreal, the result is calculated via FMath CubicInterp Performs a cubic interpolation param P end points param T tangent directions at end points param Alpha distance along spline return Interpolated value template lt class T, class U gt static FORCEINLINE DEBUGGABLE T CubicInterp( const T amp P0, const T amp T0, const T amp P1, const T amp T1, const U amp A ) const float A2 A A const float A3 A2 A return (T) (((2 A3) (3 A2) 1) P0) ((A3 (2 A2) A) T0) ((A3 A2) T1) ((( 2 A3) (3 A2)) P1) You can follow the logic in USplineComponent Draw to be convinced. And the calculation approach above is the same as the cubic hermite spline boldsymbol p (t) (2t 3 3t 2 1) boldsymbol p 0 (t 3 2t 2 t) boldsymbol m 0 ( 2t 3 3t 2) boldsymbol p 1 (t 3 t 2) boldsymbol m 1 Then the problem becomes how to convert a cubic hermite spline to a bezier curve. I have tried several conversion methods on SO https stackoverflow.com a 1099357 3427520 https stackoverflow.com a 42587252 3427520 https stackoverflow.com a 42590480 3427520 But all failed to get a correct bezier curve as USD that can be correctly rendered by Houdini. But what I have been worrying most is that USplineComponet is not a cubic hermite spline. I'm not sure since I knew few about curve math, even after reading some introduction of curve wiki, PDFs and articles. The bezier curve data to USD bezier basis curve procedure may also fail, I don't have a solution to verify converted bezier curve is correct (can generate the same shape in UE4) or not. |
42 | How to find the client's monitor valid refresh rates with Unreal Blueprints? I am making a settings menu. This includes a combo box where you can change the refresh rate setting. How do I find out the maximum allowable refresh rate of the current user's monitor, using Blueprints? |
42 | 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. |
42 | Use ramp and steps meshes as actual ramp in unreal engine 4.26 Is it possible to use a ramp mesh as an actual ramp in UE4? It seems that the system create a rectangle box around the ramp o the character does not climb the ramp, it is over it like on a box. I know that we can use landscape ramp's generator, but it's one more step that could be avoid. thanks guys! |
42 | 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. |
42 | HUD Text not displaying drawing I am trying to use blueprints to display my character's speed using a HUD, but for some reason the text is not displaying. What am I doing wrong? I am using the First Person template. |
42 | Adding 2 sounds to 1 asset I've got a sound looping from the start of the game, working exactly as I need it to. What I need is a second sound to alert the player that they have located the hidden object (the first sound is a locator sound to help them go in the right direction). My problem is that when I add the second sound to the object, there seems to be no change. Is there a way to add this second sound to go off when the player gets within the attenuation sphere? I don't want it to shut off the first sound though, just make the sound over it. That way if the player wanders away, they know where to go back to because the first sound will still be playing. |
42 | Custom event doesn't update blueprint variables Here's what I have To sum it up calling the OnInteract event (which comes from an interface) prints the 'Proceed' variable. Clicking Fire sets the variable to true and prints it. 'Proceed' is false by default. The problem is that the OnInteract event always prints 'false', even if the Fire event has been called. The Fire event correctly prints 'true', but if I call the OnInteract event later, it still prints 'false', even though logically the variable should be 'true'. No outside entity is changing the variable. If I set the default value of the variable to 'true', it prints 'true'. The entire project is just the First Person template, a single blueprint actor whose entire event graph is what you see in the screenshot, and an outside entity calling the OnInteract event when I press the button. Curiously, if I ditch the OnInteract event completely and replace it with InputAction Jump, the code works as expected and prints 'true'. What's going on? This is so simple, and yet it has me beat. |
42 | How do I add custom data to a ListView widget in Unreal? I have a UserWidget object with a ListView in it. How do I add objects add and custom data to them, such as names? |
42 | Radial circle placement of meshes How to place 10 static meshes in circular pattern so they are equaly aligned from the center ? |
42 | 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? |
42 | Setting object O2 to have the same geometric relation to P2 as O1 has to P1 I'm trying to place Object O2 with the same relation to P2 that O1 has to P1, like shown in the picture below. This is a problem that I'm facing trying to implement portals in Unreal Engine 4, where O1 is the player camera P1 is a portal O2 is a second camera, used to render the scene from the perspective of the other portal P2 is the portal linked to P1 Get the player position in relation to this portal and project it in relation to the linked portal FMatrix NewCameraWorldMatrix LinkedPortal gt GetTransform().ToMatrixWithScale() GetTransform().ToMatrixWithScale().Inverse() PlayerCamera gt GetComponentTransform().ToMatrixWithScale() FTransform NewCameraWorldTransform FTransform(NewCameraWorldMatrix) PortalCameraAnchor gt SetWorldLocationAndRotation(NewCameraWorldTransform.GetTranslation(), NewCameraWorldTransform.GetRotation()) However, the above code is not solving the problem I presented and I can't figure out why. Any ideas on what may be the issue? Note I've wrapped the PortalCamera with an Anchor since the PortalCamera must have a specific relative orientation at all times and using SetWorldLocationAndRotation directly on it would mess up its rotation. Note I have these logs (one per portal) which might be useful LogTemp Warning LogTemp Warning GetTransform().ToMatrixWithScale().Inverse() 1 2.38419e 07 0 0 2.38419e 07 1 0 0 0 0 1 0 1410 1570 420 1 LogTemp Warning LinkedPortal gt GetTransform().ToMatrixWithScale() 1 0 0 0 0 1 0 0 0 0 1 0 820 1410 420.238 1 LogTemp Warning PlayerCamera gt GetComponentTransform().ToMatrixWithScale() 0.572059 0.791792 0.214041 0 0.810578 0.585631 0 0 0.125349 0.173497 0.976825 0 372.749 65.9088 332.374 1 LogTemp Warning NewCameraWorldMatrix 0.572059 0.791793 0.214042 0 0.810578 0.585631 5.10315e 08 0 0.125349 0.173497 0.976825 0 767.052 3445.01 144.706 1 LogTemp Warning NewCameraWorldTransform.GetTranslation() X 767.052 Y 3445.011 Z 144.706 LogTemp Warning NewCameraWorldTransform.GetRotation() X 0.095848404 Y 0.048997864 Z 0.885227978 W 0.452530354 LogTemp Warning LogTemp Warning GetTransform().ToMatrixWithScale().Inverse() 1 0 0 0 0 1 0 0 0 0 1 0 820 1410 420.238 1 LogTemp Warning LinkedPortal gt GetTransform().ToMatrixWithScale() 1 2.38419e 07 0 0 2.38419e 07 1 0 0 0 0 1 0 1410 1570 420 1 LogTemp Warning PlayerCamera gt GetComponentTransform().ToMatrixWithScale() 0.572059 0.791792 0.214041 0 0.810578 0.585631 0 0 0.125349 0.173497 0.976825 0 372.749 65.9088 332.374 1 LogTemp Warning NewCameraWorldMatrix 0.572059 0.791792 0.214041 0 0.810577 0.585631 5.10314e 08 0 0.125349 0.173497 0.976825 0 767.11 3444.93 145.171 1 LogTemp Warning NewCameraWorldTransform.GetTranslation() X 767.110 Y 3444.927 Z 145.171 LogTemp Warning NewCameraWorldTransform.GetRotation() X 0.095848396 Y 0.048997886 Z 0.885228097 W 0.452530175 LogTemp Warning |
42 | Selecting Hiding is broken for Perspective but works for Orphographics views. Why? I'm learning Unreal4. Got a problem with selecting, focusing and hiding objects. Focusing Issue Focusing have to be done separatly for perspective view and ortho view. Why it is so? Example If I select an object in perspective view and focus on it (key F) everything works only for perspective view, but at the same time in ortho view no focusing occurs. So inorder to focus on the object in the ortho plales too I have repeat the whole process again find object in orpho plane, select it, click F and only then focusing happens in all ortho view planes. In perspective view quot Show only selected quot does not work, but works in ortho views The same issue with quot Show all actors quot . Please, I need help. Thnaks. P.S. Damn, it looks like I'm in some kind of a mode (for the lack of a better word). I mean in my clicking around, i've clicked ON some mode and now this selection hiding thing works buggy... |
42 | Unreal Engine Niagara Particle Velocity Based on Density of Particles? Goal Simulation of particles where each particle moves to the direction with the highest density out of candidate directions. I'm not sure how to do the following operations using UE Niagara. How to look at the positions of other particles within a Niagara Emitter. I know how to access to the position of other emitters using event handlers. How to read the positions of particles that are in a certain region in the 3D space (eg. within the bounding box of (0,0,0) (1,1,1)) efficiently. Please feel free to suggest any other features within UE, but I think Niagara is the way to go. |
42 | 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. |
42 | Where do I have to put actions when the game state changes I ve just started to learn Unreal Engine implementing a clone version of Atari s Pong game. I m thinking about where to put the code to change the state of the game. I have an enum in the GameState class to manage when the game hasn t started, or when we are playing the game. In case when someone scores I decided that I have to stop the ball and move it to its initial position. My problem comes here because I don t know where to put the code to do that on GameMode class or on GameState class. Where do I have to put that code? |
42 | Destroy multiple actors by pressing a button I'm making a simple project to learn Unreal Engine. I have 50 actors (blueprints) and at the start a function will loop 5 times and spawn 5 of the 50 actors randomly. How can I destroy the actors by pressing a button, irrespective of which of the 50 actors are spawned? |
42 | Unable Compile Unreal Project into .Exe File I'm new to Unreal Engine and I've been looking for an answer online but I don't understand why the project I just started on is unable to compile. I only used the default blueprints. The error logs are below. UATHelper Packaging (Windows (64 bit)) Running AutomationTool... UATHelper Packaging (Windows (64 bit)) Parsing command line ScriptsForProject C Users belmo OneDrive Documents GitHub EscapeFromDarksidePenitentiary EscapeFromDarkSide EscapeFromDarkSide.uproject BuildCookRun nocompileeditor installed nop4 project C Users belmo OneDrive Documents GitHub EscapeFromDarksidePenitentiary EscapeFromDarkSide EscapeFromDa rkSide.uproject cook stage archive archivedirectory C Users belmo OneDrive Documents GitHub EscapeFromDarksidePenitentiary EscapeFromDarkSide package ue4exe quot C Program Files Epic Games UE 4.26 Engine Binaries Win64 UE4Editor Cmd.exe quot ddc InstalledDerivedDataBackendGraph pak prereqs nodebuginfo targetplatform Win64 clientconfig Development utf8 output UATHelper Packaging (Windows (64 bit)) Setting up ProjectParams for C Users belmo OneDrive Documents GitHub EscapeFromDarksidePenitentiary EscapeFromDarkSide EscapeFromDarkSide.uproject UATHelper Packaging (Windows (64 bit)) COOK COMMAND STARTED UATHelper Packaging (Windows (64 bit)) Running UE4Editor Cook for project C Users belmo OneDrive Documents GitHub EscapeFromDarksidePenitentiary EscapeFromDarkSide EscapeFromDarkSide.uproject UATHelper Packaging (Windows (64 bit)) ERROR Cook failed. UATHelper Packaging (Windows (64 bit)) (see C Users belmo AppData Roaming Unreal Engine AutomationTool Logs C Program Files Epic Games UE 4.26 Log.txt for full exception trace) PackagingResults Error Cook failed. UATHelper Packaging (Windows (64 bit)) AutomationTool exiting with ExitCode 25 (Error UnknownCookFailure) UATHelper Packaging (Windows (64 bit)) BUILD FAILED PackagingResults Error Unknown Cook Failure LogD3D11RHI CreateSwapChainForHwnd failed with result 'DXGI ERROR INVALID CALL' (0x887A0001), falling back to legacy CreateSwapChain. LogEditorViewport Clicking on Actor (LMB) StaticMeshActor (Cube11) LogSlate Window 'Output Log' being destroyed LogSlate Window 'Output Log' being destroyed LogD3D11RHI CreateSwapChainForHwnd failed with result 'DXGI ERROR INVALID CALL' (0x887A0001), falling back to legacy CreateSwapChain. LogD3D11RHI CreateSwapChainForHwnd failed with result 'DXGI ERROR INVALID CALL' (0x887A0001), falling back to legacy CreateSwapChain. LogD3D11RHI CreateSwapChainForHwnd failed with result 'DXGI ERROR INVALID CALL' (0x887A0001), falling back to legacy CreateSwapChain. LogD3D11RHI CreateSwapChainForHwnd failed with result 'DXGI ERROR INVALID CALL' (0x887A0001), falling back to legacy CreateSwapChain. LogD3D11RHI CreateSwapChainForHwnd failed with result 'DXGI ERROR INVALID CALL' (0x887A0001), falling back to legacy CreateSwapChain. LogD3D11RHI CreateSwapChainForHwnd failed with result 'DXGI ERROR INVALID CALL' (0x887A0001), falling back to legacy CreateSwapChain. LogD3D11RHI CreateSwapChainForHwnd failed with result 'DXGI ERROR INVALID CALL' (0x887A0001), falling back to legacy CreateSwapChain. LogD3D11RHI CreateSwapChainForHwnd failed with result 'DXGI ERROR INVALID CALL' (0x887A0001), falling back to legacy CreateSwapChain. LogD3D11RHI CreateSwapChainForHwnd failed with result 'DXGI ERROR INVALID CALL' (0x887A0001), falling back to legacy CreateSwapChain. LogD3D11RHI CreateSwapChainForHwnd failed with result 'DXGI ERROR INVALID CALL' (0x887A0001), falling back to legacy CreateSwapChain. LogD3D11RHI CreateSwapChainForHwnd failed with result 'DXGI ERROR INVALID CALL' (0x887A0001), falling back to legacy CreateSwapChain. LogEditorViewport Clicking on Actor (LMB) StaticMeshActor (Cube11) |
42 | What is the correct way to make an Installed Build? I am trying to use the Automation tool, following the documentation. To create an Installed Build Run the Installed Build Script by invoking the AutomationTool with the following command line, replacing PLATFORM with either Win64 or Mac. BuildGraph target quot Make Installed Build PLATFORM quot script Engine Build InstalledEngineBuild.xml clean However, I am getting this error. ERROR Target 'Make Installed Build Win64 ' is not in graph I am not sure what I should put as the platform. I searched the config file, but don't see any specified platforms. |
42 | 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? |
42 | How can I expose material parameters in the Unreal level editor? Is there a way to expose material parameters in Unreal 4 so that they are accessible from the level editor? As far as I know, I can only do this through the Material Editor, but I wish to do it more fluently. E.g. to edit a color for the currently selected object in a level |
42 | 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? |
42 | 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 |
42 | Is there a way to assign a texture to a button and resize it in the Unreal Engine? I'm attempting to create a main menu for my game and have followed an easy tutorial to do so. The tutorial doesn't cover assigning textures or images to buttons, so I set out to do this myself. Assigning the image to the button (I have a 'normal', 'hover', and 'clicked' texture) was rather easy, but the images don't fit. Using the 'Image Size' options don't do anything at all and I've got no idea on how to change the image without going back into Photoshop or GIMP and just redoing the whole image to fit the button size. Is there any way to actually change the size of the image inside the button in Unreal? Or do I just have to suck it up and re do it? |
42 | Deactivate VS warning "Macro in skipped region" Since the UE4 API relies heavily on macros outside of function bodies, the IntelliSense function (not the compiler!) of Visual Studio 2017 throws a lot of warnings with update 15.7, also visible in the scroll area. Is there a possibility in the Visual Studio settings to deactivate such kind of warnings? The option to deactivate IntelliSense Tools Options Text Editor C C Advanced Disable IntelliSense will disable those warnings. However I don't want to renounce IntelliSense completely. Maybe Visual Studio offers more fine grain control over IntelliSense via its GUI or some settings file to disable only those macro warnings? EDIT The Visual Studio team recommends using a .hint file to register macros as workaround. However maintaining a separate macro list is not the way to go. You can also vote there that the VS Team works on that. |
42 | How to enable treat warnings as errors in Unreal Engine 4.24? I've had little luck googling and it takes about an hour to build the engine (which I have to do if I'm to test if it works), so guessing is a bit time consuming. I've seen advice to add the ' WX' flag to .target.cs, as well to one of the functions in VCToolChain.cs, but I wasn't able to make it work. Has anyone here enabled this and knows how it works? I don't think it matters, but I've been using VS2017. |
42 | Displacement map to create terrain I am trying to figure out the best way to create a procedurally generated terrain at runtime in Unreal Engine 4. For the moment, my idea is to generate a heightmap and apply it to a plane as a displacement map, since it sounds a lot simpler than trying to procedurally generate a mesh. Is it how it is generally done? And if not, will I run into issues by doing it this way? |
42 | Recreating Common "Glowing Pillar" Effect in UE4 I've noticed a common "glowing pillar beacon" effect in a few games lately (Overwatch, Fortnite, etc). The effect provides a translucent glowing beam pointing upwards that tapers off towards the top and fades out. I'm attempting to recreate the effect and was wondering if this is some form of particle emitter and what is involved in the effect? Thanks! Examples |
42 | 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! |
42 | Floor is moving faster than ball above it , and it causes ball to fall off the map. UE4 I am creating a game ( following Udemy lesson on Marble run) which is basically a maze and ball and we move ball my rotating floor on x or y axis through obstacles . Floor movement is linked on Mouse values. BP My problem is if I move my mouse too fast ball comes below floor and drops. I know there could be multiple hacks to solve this . but I am looking for best solution ( professional solution) I am a newbie so please bear with me ) Below is screenshot of ball below maze |
42 | Can I combine 2 UnrealEngine forks? I am using Daz Gen 8 characters and clothes in my project. After I read this I decided to use a fork of UE4 which uses Dual Quaternion Skinning. Basically if you use Daz characters under UE4, they going to distort better if you use DQS, which UE4 doesn't support by default. You can get the DQS modded engine from here. I compiled it and I managed to get all my stuff from my original project to a DQS one. No problem. But I also need a soft body and a clothing solution in the project. 4.25 has a clothing solution and it does work fine, but there is no soft body, that I know about... So there are a few options Vico Dynamics from the Marketplace using a Flex branch of UE4 if you know any more please please let me know Tested Vico, and it works fine for simple meshes, up to 20k poligons. Over that the editor becomes unresponsive... But this works with my modded DQS engine. The latest version of an UE4 branch with Flex is 4.22. I could get this compiled and running. I would like to know if I can merge the 2 repositiories (4.22 DQS and Flex) into one, and source build it... What software or workflow do you recommend to do merge these big branches of UE4? I guess there will be quite a few conflicts, because Flex distorts the mesh in it's own way, so does the DQS version of Unreal... |
42 | Why Are Some Foreign Characters Not Displaying Properly I am localizing a game for the first time and I'm noticing some characters are not displaying properly. Most are fine but there is a small handful that are not correct. For example on a loading screen I display the word Loading. In German I'm displaying L dt. The character is not displayed as , instead isn't displayed as shown in the image. I'm running in a standalone game. I packaged a development build to see if the problem was there too but it seem localizing is not working when I package it but I can tackle that problem later unless there is a known issues with this. To change languages I am calling Set Current Culture in blueprints. |
42 | 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? |
42 | What is the equivalent node in UE4 for Blender's Musgrave Node? I'm trying to recreate Poliigon's non tiling nodes https www.youtube.com watch?v VgtSL5ZpYc, in UE4, and the only thing so far I don't see the equivalent to is the Musgrave node https docs.blender.org manual en latest render shader nodes textures musgrave.html, though UE4 has Perlin 3D Noise nodes, I don't see octave control described here https docs.unrealengine.com en US Engine Rendering Materials ExpressionReference Vector index.html Is there a way to accomplish this? I assume so, UE4 cannot not have it... unless they already have a non tiling node function already, and I don't know about it. |
42 | Unreal Engine Size on Disk I want to install Unreal Engine 4 from the epic game launcher but I have the following problem If I want to install the engine after about 50 it says I don't have enough space on my disk, and if I look up how much space the folder took it says 75 GB is that normal? |
42 | Where do I have to put actions when the game state changes I ve just started to learn Unreal Engine implementing a clone version of Atari s Pong game. I m thinking about where to put the code to change the state of the game. I have an enum in the GameState class to manage when the game hasn t started, or when we are playing the game. In case when someone scores I decided that I have to stop the ball and move it to its initial position. My problem comes here because I don t know where to put the code to do that on GameMode class or on GameState class. Where do I have to put that code? |
42 | 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. |
42 | What does rebuilding the .vcxproj file do? I'm having the same problem this user had. The solution is confusing me, because all I want to do is comment out the code I added that caused the compiler crash, get Unreal to accept it and stop crashing, but he sounds like he is rebuilding the whole engine, and I just have one crashing project. I tried commenting out the code and saving the visual studio project, but it didn't change anything. What is his solution doing? |
42 | UE4 storing complex actors in Game Instance I want to make a game where I can hold tools in my hand and inventory. Obviously I want to pass them between levels and maybe even game sessions. Question is, how would I do that? With simple variables like amount of money or HP, all I do is store a variable in the Game Instance. But what about, for example, a tool that has more data, like the class type, durability, maybe value? Even worse, whole array of them? The way I use that in game is, there's an actor representing the tool. But even if I store array of those in the game instance, the actors get destroyed while changing level and the array just points empty memory. I could just spawn new ones by using the class type but that is not enough for me. My idea is to create something... maybe a struct, that would hold the information and then recreate the inventory item actors according to the data in the struct. My questions What are other ways to do it? and Is there something fundamentally wrong with the way I'm storing the items in my inventory now? |
42 | Textures on grass not showing on android I'm using assets from InfinityBladeGrassLands, and used SM Plains Grass01 for some foliage on my landscape. In editor, the foliage looks like this But when building for andoroid, this is what shows up What's the problem here? Edit I manually added an instance of the grass to the viewport, and that one is showing fine in android, but still the rest added using Foliage tool are not. |
42 | 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. |
42 | increasing speed of sound as player approaches I am trying to create a sound that increases in speed as the player gets closer to the object. The sound is just a single 'ping' and will increase in frequency as we approach, once we are on top of it, it should play a different sound. I can't seem to get it to work. Here is what I've done in blueprints I'm not extremely experienced with Blueprints and I have almost no experience with working with sound in it. From my understanding, the blueprint should be measuring the distance between the object and the player, dividing it by .5, and then returning the sound at that speed. Currently, I'm getting no sound whatsoever. |
42 | 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. |
42 | What is the correct way to make an Installed Build? I am trying to use the Automation tool, following the documentation. To create an Installed Build Run the Installed Build Script by invoking the AutomationTool with the following command line, replacing PLATFORM with either Win64 or Mac. BuildGraph target quot Make Installed Build PLATFORM quot script Engine Build InstalledEngineBuild.xml clean However, I am getting this error. ERROR Target 'Make Installed Build Win64 ' is not in graph I am not sure what I should put as the platform. I searched the config file, but don't see any specified platforms. |
42 | I want to drop a platform after I land on it I want to disable z axis translation lock 2 seconds after my player hits the object in question. I am using Unreal 4. Been slamming my head against it for a week and a half, please save this newb. I just noticed this is the iteration where I enabled gravity instead of disabling z lock... the intended result is be the same for both of these UPDATE now the thing drops but it doesnt wait for the timer UPDATE! I DID IT! |
42 | 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? |
42 | 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? |
42 | Unreal Engine 4 HierarchicalInstancedStaticMesh (HISM) not distance culling What I'm trying to do I am trying to programmatically spawn a lot of HierarchicalInstancedStaticMesh on a very very large ProceduralMeshComponent (PMC) (very simplified for the sake of this question). I generate the quot ground quot PMC in chunks during run time, and then spawn instances at points on the mesh. An initial n amount of these are generated before the player spawns. Additional chunks spawn by calculating values with a separate thread and then spawning them from the original thread. All I am doing in the separate thread is calculating vectors essentially I have an actor with just a HISM component at the root. Cull start and end distance is set to 5000 Mesh material has Dithered LOD Transition set to true What is happening The culling on the HISM is simply not working. Sometimes It won't even show up to begin with When it does show up, it doesn't cull no matter how far away the camera gets (spectator) Sometimes it will cull correctly on the initially spawned chunks, but not on the chunks that were generated and spawned after the player spawned The weirdest part, is that I am also spawning an HISM of a different mesh in exactly the same manner, and it is culling perfectly (though admittedly there are far FAR fewer instances) Example code Here is an example of what I am trying to do. The Terrain actor is placed in the world, the HISM is referenced in a public variable, and this code runs in BeginPlay (and Tick, for subsequent chunks) Terrain.H The Actor with the HISM as the root component UPROPERTY(Category quot hism quot , BlueprintReadWrite, EditAnywhere) TSubclassOf lt AActor gt FoliageInstance Terrain.cpp auto spawner World gt SpawnActor lt AActor gt (FoliageInstance, FVector(0, 0, 0), FRotator ZeroRotator) Another class I wrote that just calculates a ton of vectors TArray lt FVector gt spawnPoints OtherClass.GetATonOfRandomVectors() Add an instance for each of the spawn points for (auto amp spawn spawnPoints) FRotator grassRotation FRotator(rand() 5, rand() 360, rand() 5) FTransform grassTransform FTransform(grassRotation, spawn) if (spawner ! nullptr) auto instance Cast lt UHierarchicalInstancedStaticMeshComponent gt (spawner gt GetRootComponent()) instance gt AddInstance(grassTransform) |
42 | Can I combine 2 UnrealEngine forks? I am using Daz Gen 8 characters and clothes in my project. After I read this I decided to use a fork of UE4 which uses Dual Quaternion Skinning. Basically if you use Daz characters under UE4, they going to distort better if you use DQS, which UE4 doesn't support by default. You can get the DQS modded engine from here. I compiled it and I managed to get all my stuff from my original project to a DQS one. No problem. But I also need a soft body and a clothing solution in the project. 4.25 has a clothing solution and it does work fine, but there is no soft body, that I know about... So there are a few options Vico Dynamics from the Marketplace using a Flex branch of UE4 if you know any more please please let me know Tested Vico, and it works fine for simple meshes, up to 20k poligons. Over that the editor becomes unresponsive... But this works with my modded DQS engine. The latest version of an UE4 branch with Flex is 4.22. I could get this compiled and running. I would like to know if I can merge the 2 repositiories (4.22 DQS and Flex) into one, and source build it... What software or workflow do you recommend to do merge these big branches of UE4? I guess there will be quite a few conflicts, because Flex distorts the mesh in it's own way, so does the DQS version of Unreal... |
42 | Modular weapon in UE4 editor I want to create a modular weapon system. I already got most of it working, but I wonder how to make an improvement. Weapons in my game have different firing modes (semi and auto) and "bullet" modes (projectile and hitscan). Each weapon is it's own blueprint, and there I can select proper one in editor, so for example an Uzi would be auto histcan, while a rocket launcher would be semi projectile. (the firing mode actor gets created at spawn from the class selected in editor). I want to make it easier to edit by giving the weapon some variables, like spread and projectile blueprint. But not all of the variables apply to all the types of weapon... TLDR Can I create show different variables in the editor, depending on other variables? If I choose projectile type of weapon, can I also select the projectile type, but not show the option if I chose hitscan? |
Subsets and Splits