cassius Posted March 11, 2012 Share Posted March 11, 2012 Now my enemy character has a controller I find that it flickers badly whenever it collides with a physics object such as an oildrum or my main character. It stops flickering after first contact but is irritating to watch. I have played around with the updatecontroller code and stopped the controller sliding but it still flutters. Anyone solved this problem? UpdateController(bg_control,badguy.rotation.y,1.5,0, 0, 1,400,0) Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Canardia Posted March 11, 2012 Share Posted March 11, 2012 The cause for this is usally missing game logic. Use lots of boolean flags to check the states of everything, that makes it very easy to write the code and read the code. Often 2-8 nested if checks are needed to make things work right, and it's always better to let the if-check fail than to do stuff which slows down the game and makes it flicker or otherwise behave errationally. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
cassius Posted March 11, 2012 Author Share Posted March 11, 2012 Thanks. Had some flicker when I used moveentity to move controllers but not as bad as with updatecontroller. The flicker occurs when enemy collides with player character. and anim changes from walk to attack anim. Maybe its not a smooth transition from one anim to another. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Marleys Ghost Posted March 11, 2012 Share Posted March 11, 2012 Well, if you are changing the anim state by collision yes/no then unless there is constant contact maybe you are switching back and forth between the two anim states? As I said on your other thread its hard to speculate without demo/code/video. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Canardia Posted March 11, 2012 Share Posted March 11, 2012 With animation sequence changes you also need a few boolean flags, like one for telling if it's allowed to change yet, one for the cooldown timer between sequence changes. You can first make the cooldown timer longer, to visually debug what's going on. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Aily Posted March 11, 2012 Share Posted March 11, 2012 If you are talking about body (with debugphysics on) - it's normal situation. Mesh attached to it moves smooth. Quote "Better" is big enemy of "good" Link to comment Share on other sites More sharing options...
cassius Posted March 11, 2012 Author Share Posted March 11, 2012 I am changing the anim sequence acording to the distance between enemy character and main(third person) character using entityDistance. PointEntity(badguy, player,3,1.0) If stopanim2 = False If EntityDistance(jane,bg_pos) < 15.0 bg_framebegin = 77 bg_frameend = 115 animate_badguy() ' badguy walk UpdateController(bg_control,badguy.rotation.y,1.6,0, 0,1,100,0) EndIf EndIf If EntityDistance(jane,badguy) <= 3.0 pointEntity(badguy,jane) jane_framebegin = 924 ' jane attack jane_frameend = 1031 animate_jane() bg_framebegin = 291 animate_jane() bg_frameend = 411 animate_badguy() 'badguy attack bg_health = bg_health - 0.1 EndIf If bg_health <= 1 Then kill_badguy() EndIf Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.