Jump to content
  • Advertisement
    1. Past hour
    2. It looks like you didn't understand the code you where using in Blitz3D I will explain it so that you can see Godot is exactly the same: If Keydown(up_key) Then MoveEntity Object 0,1,0 If Keydown is your input. You use this to tell what input to check. The MoveEntity Object is the target this gode has to move and 0,1,0 and this last part is your vector. Godot works exactly the same: if Input.is_action_pressed("ui_up"): move_and_slide (Vector3(0,1,0)) if Input.is_action_pressed("ui_up") this is you input check. move_and_slide() by default move and slide will execute on the target object. Last is the vector Vector3(0,1,0) Godot uses long names that clearly define what each thing does, to make it easy as you don't have to remember abbreviations. So the simplest movement in Blitz3D looks like this: If Keydown(up_key) = true Then MoveEntity Object 0,1,0 If Keydown(down_key) = true Then MoveEntity Object 0,-1,0 If Keydown(right_key) = true Then MoveEntity Object 1,0,0 If Keydown(left_key) = true Then MoveEntity Object -1,0,0 The simplest Godot version is like this: if Input.is_action_pressed("ui_up"): move_and_slide (Vector3(0,1,0)) if Input.is_action_pressed("ui_down"): move_and_slide (Vector3(0,-1,0)) if Input.is_action_pressed("ui_right"): move_and_slide (Vector3(1,0,0)) if Input.is_action_pressed("ui_left"): move_and_slide (Vector3(-1,0,0)) The nice thing about Godot is that you can visually see what part is the IF part and what part is the Execute part. Both these methods are considered bad practice when working with games. Because code runs from the top line to the lower line. Meaning that if you move like this and pressed both the up and down key, the object will always move down. So to fix this the Godot tutorial uses math, to provide better input like this: #The vector is made above all the other code, so that the other code can change it var velocity = Vector3(0,0,0) if Input.is_action_pressed("ui_up"): velocity.y += 1 #this now makes velocity Vector3(0,1,0) if Input.is_action_pressed("ui_down"): velocity.y += -1 #this now makes velocity Vector3(0,-1,0) if Input.is_action_pressed("ui_right"): velocity.x += 1 #this now makes velocity Vector3(1,0,0) if Input.is_action_pressed("ui_left"): velocity.x += -1 #this now makes velocity Vector3(-1,0,0) velocity = move_and_slide(velocity) #this now calculates the smooth movment using the combined So the reason Godot teaches it like this, is that velocity increases or decreases as you hold the button. The += means Velocity.x = Velocity.x+1 in other words it's own value plus one. If you used just = then it would be 1 and this would mean that down would cancel up, instead of slowing down. Of course you could have done the same thing in Blitz3D, to get more realistic input. No, Unity doesn't have simple collisions. You would have needed to grab the rigidbody component and add force to it. Or if you really wanted the simple collision style you would have to emulate it using rays, here is a 2D example: https://answers.unity.com/questions/972878/simple-top-down-2d-collision.html Godot is much closer to Blitz3D than Unity. It looks like you are having a hard time because you don't know programming. I recommend you do a few python tutorials. Python is easy and is very-very similar to GDScript.
    3. Zombie Commander is now available on Google Play Store : https://play.google.com/store/apps/details?id=com.pokandco.Zombies
    4. Zakwayda

      Keep object in camera view

      Here's a couple more questions (some more information about the desired behavior might make it easier to help). It seems clear from the video you posted that you want tracking to be restricted so that the target object remains visible. What about yaw and pitch? If the camera rotates so that the object goes out of view, is that ok? Or do you want to disallow that? Also, does the camera actually orbit, or does it just rotate in place? (I see reference to orbiting in the code, but the code looks like it just rotates in place.)
    5. Today
    6. Wyrframe

      Creating A Grid of Images

      You don't need to load a separate Image for every Sprite. You can load your two brick images once each, and then create any number of Sprites which all use one or the other of those Images. That's the difference between an Image and a Sprite; the first is just simple bitmap data, and the other is a scene graph element which describes what to draw and where. For that sharp of a drop, I bed there's something odd about how you're creating and using Brick. I'm guessing you're instantiating a Brick once per frame, instead of once per scene reset? class BrickGrid(): def __init__(self, space): self.batch = pyglet.graphics.Batch() self.sprite_list= [] # I really don't know Python, there must be a better way to do this: # Create a list of brick images, and load each file in turn. brick_images = ['brick1.png', 'brick2.png'] for index in range(len(self.brick_images)): brick_images[index] = pyglet.image.load(brick_images[index]) for x in range(7): for y in range(7): body = pymunk.Body(body_type=pymunk.Body.KINEMATIC) body.position = x * 100 + 75, y * 30 + 340 image = brick_images[random.randint(0, len(brick_images) - 1)] sprite = pyglet.sprite.Sprite(image, x=body.position.x, y=body.position.y, batch=self.batch) self.sprite_list.append(sprite) shape = pymunk.Segment(body, (0, 0), (50, 0), 6) shape.elasticity = 0.80 shape.collision_type = collision_types['brick'] space.add(body, shape)
    7. Stevens R. Miller

      C# variable name creates error

      C# will also let you start an identifier with just the underscore. So, if you want the first alphanumeric character to be a digit, you can use this: bool _3D_pressed; You'll probably have to listen to some howling from your colleagues if you do this, though. Using the underscore as the first character in an identifier is typically reserved for special purposes (like storing the "backing" value of a property). So, mostly, I mention this for the purpose of advising against doing it. Rutin's suggestion is really the better alternative. Also, you might pick up a copy of "The Elements of C# Style." It's an easy to use reference on the conventions most commonly used to guide your choices in writing C# code.
    8. phantaminum

      phantaminum's tunes (new track every Friday!)

      An orchestral piece that I've been working on for a bit, hope you all like it!
    9. Wyrframe

      Need library/engine/whatever

      http://love2d.org ? Built-in Box2D, OpenGL, Lua, has thread and socket libraries built in, pretty good performance thanks to LuaJIT but you can also build and load C/++ DLLs if you need something closer to metal.
    10. davejones

      Keep object in camera view

      I believe so yes. Its a script I am using from an asset I have purchased so if I am wrong I do apologise, but from the testing I have done your analysis appears to be correct.
    11. nsmadsen

      Creating the Same Mood of Another Song

      Without You Here - your tempo is a bit slower but, more importantly than that, your backing track is using longer note durations than Fisherman's Horizon. Horizon uses a lot more 8th note arpeggios and your piece is using a 1 & 2 3 (half note here). So half of your measure is already four times slower as the 8th note pace (if you go from 8th up to half note duration). Even if you had exactly the same BPM setting, your piece will feel slower just with that difference in the arrangement's rhythm. Later on you do have some 1 & 2 then quarter notes on beats 3 and 4. Also the timber of the synth patch you're using is set in a lower octave and has a darker sound than the FF8 reference piece. Your piece also feels more reflective and introspective to me. Almost even melancholy. Whereas the FF8 reference track is more peaceful and uplifting. I think this is partly because of the chordal progressions and resolutions used. Your piece, by itself, sounds good but I don't think it's a good pairing for trying to recreate the same mood as Horizon from FF8. Maybe take a look at the various parts/elements I mentioned and if you want, make an alternate version where you make some tweaks to better match up the song's mood with your reference track. Best of luck!
    12. Luis Carlos Zardo

      new screenshot

      Today´s screenshot
    13. The purpose of this is to get me started in a direction as far as knowing what to look at or evaluate. I need either a library, or an engine. I could consider cannibalizing source to make something custom, if necessary. A few things: - Open source, and/or free. - 2D. - Realtime. - At a minimum I will need collision detection. I may go full-bore physics, but it won't need to be super-fancy - e.g. complicated joints, rag doll dynamics, etc. - it would just need to be basic collision physics. - As for platforms, no Microsoft, no .NET, no C#, etc. Also, it would need to be either OpenGL, or something like that which is 'standard' and freely available. At a minimum, this would run on Linux, preferably FreeBSD. - Would prefer non-Java. If I'm having to compile something, or link into some library, best would probably be C/C++. - This is important. I need something parallelizable. Meaning, I would like to run a bunch of 'whatever' I will be using (engines or whatever) on multiple cores, possibly even multiple machines, and I would like them to ALL tackle the SAME problem. Just think of some big simulation, with multiple processors producing the simulation. - Performance is a concern. - I don't know how hardware acceleration factors into this, if at all. I know it is generally used for the graphics. But here, my concern is the collision resolution, and possibly the physics, but not the graphics at this juncture. So, you tell me.
    14. CrazyCdn

      C# variable name creates error

      Just as an aside, C/C++ has this same rule; no variable, class, struct or function (C#'s member) can start with a number. Not sure about other programming languages.
    15. I just don't know why you're focusing on these irrelevant and completely arbitrary things like install size and code length. It's like going car shopping and focusing on the floor mats and tire irons. I don't know why you're focusing on these two things and honestly I don't think you know why either. As for the actual code length, it's as long as it needs to be. If you want even shorter code, look at engines like GameMaker and Construct, which have default character controllers you can drag onto objects. That's 0 lines of code, but as soon as you need that controller to do something a bit different you're back to the same problems every other engine her: gathering either 4 buttons or 2 axes of input and moving the character with that. Every game engine will provide an API to do this and it's just a matter of using that API to do what you need. Whether one API has longer function names (Input.is_action_pressed("up") vs key("up"), for example) is utterly irrelevant. It's a bit of typing, that's it. If that's really what's making you choose one engine over another, I just don't know what to say.
    16. piecuch.p

      liboggvorbis as a single-file

      liboggvorbis combined into one file - might be usefull if you want to simpifie dependencies of your project. Get it here. -rw-r--r-- 1 piecuchp staff 2.0M Apr 26 17:55 oggvorbis.c -rw-r--r-- 1 piecuchp staff 134K Apr 26 17:55 oggvorbis.h -rw-r--r-- 1 piecuchp staff 3.1M Apr 26 17:55 oggvorbis.o Combining script is quite complex and not well commented (also I might make some changes into source code that I don't recall right now) but maybe someone find it usefull: #!/bin/bash src_c="\ \ lib/codebook.h lib/mdct.h lib/envelope.h lib/smallft.h lib/codec_internal.h lib/lookup.h lib/lookup_data.h lib/lpc.h lib/lsp.h lib/masking.h lib/misc.h lib/os.h lib/registry.h lib/scales.h lib/window.h\ lib/books/floor/floor_books.h lib/books/coupled/res_books_stereo.h lib/books/uncoupled/res_books_uncoupled.h lib/books/coupled/res_books_51.h\ lib/analysis.c lib/bitrate.c lib/block.c lib/codebook.c lib/envelope.c lib/floor0.c lib/floor1.c lib/info.c lib/lookup.c lib/lpc.c lib/lsp.c lib/mapping0.c lib/mdct.c lib/psy.c lib/registry.c lib/res0.c lib/sharedbook.c lib/smallft.c lib/synthesis.c lib/vorbisenc.c lib/vorbisfile.c lib/window.c\ " src_h="\ include/ogg/config_types.h include/ogg/os_types.h include/ogg/ogg.h\ lib/ogg/bitwise.c lib/ogg/framing.c\ include/vorbis/codec.h include/vorbis/vorbisenc.h include/vorbis/vorbisfile.h\ " mkdir -p lib-portable files=0 C="lib-portable/oggvorbis.c" H="lib-portable/oggvorbis.h" echo "/** $0: `date`*/" > "$C" echo "" >> "$C" echo "_#include \"oggvorbis.h\"" >> "$C" echo "" >> "$C" echo "#define _BUILD_SINGLE_SOURCE" >> "$C" echo "#ifdef __cplusplus" >> "$C" echo "# define restrict __restrict__" >> "$C" echo "#endif" >> "$C" echo "" >> "$C" echo "/** $0: `date`*/" > "$H" echo "" >> "$H" line_offset=3 for c in $src_c; do if [ -e "$c" ]; then echo "/** $0: $c*/" >> "$C" echo "" >> "$C" #line=`cat "$C"|wc -l` echo "#line $line_offset \"$c\"" >> "$C" cat $c \ | sed "s/\([^_]\)ilog/\1ilog${cnt}/g" \ | sed "s/FLOOR1_fromdB_LOOKUP/FLOOR1_fromdB_LOOKUP${cnt}/g" \ | sed "s/bitreverse/bitreverse${cnt}/g" \ >> "$C" echo "" >> "$C" ((cnt++)) echo -n "." else # use '' for space echo "" >> "$C" echo "${c//\'\'/ }" >> "$C" echo "" >> "$C" echo -n "_" fi done for h in $src_h; do if [ -e "$h" ]; then echo "/** $0: $h*/" >> "$H" echo "" >> "$H" echo "#line $line_offset \"$h\"" >> "$H" cat $h >> "$H" echo "" >> "$H" ((cnt++)) echo -n "." else # use '' for space echo "" >> "$H" echo "${h//\'\'/ }" >> "$H" echo "" >> "$H" echo -n "_" fi done for i in lib/modes/*.h; do inl=`basename "$i"` sed -i "" -e "/#include \"modes\/$inl\"/r $i" -e "/#include \"modes\/$inl\"/d" "$C" echo -n "@" done echo "" sed -i "" -e "/^#\(.*\)include \".*\.h\".*$/d" "$H" sed -i "" -e "/^#\(.*\)include \<ogg\/.*\.h\>.*$/d" "$H" "$C" sed -i "" -e "/#include_inline \"psy.h\"/r lib/psy.h" -e "/#include_inline \"psy.h\"/d" "$C" sed -i "" -e "/#include_inline \"bitrate.h\"/r lib/bitrate.h" -e "/#include_inline \"bitrate.h\"/d" "$C" sed -i "" -e "/#include_inline \"highlevel.h\"/r lib/highlevel.h" -e "/#include_inline \"highlevel.h\"/d" "$C" sed -i "" -e "/#include_inline \"backends.h\"/r lib/backends.h" -e "/#include_inline \"backends.h\"/d" "$C" sed -i "" -e "/#include_inline \"asm_arm.h\"/r tremor/asm_arm.h" -e "/#include_inline \"asm_arm.h\"/d" "$C" sed -i "" -e "/# include \"collect.c\"/r theora/lib/collect.c" -e "/# include \"collect.c\"/d" "$C" sed -i "" -e "/^#\(.*\)include \".*\.h\".*$/d" "$C" sed -i "" -e "/^#\(.*\)include \<theora\/.*\.h\>.*$/d" "$C" sed -i "" -e "s/^_#/#/" "$C" echo "** Done (with $cnt files)"
    17. Zakwayda

      Keep object in camera view

      From the code you posted, it looks like the camera can track forward and backward and side to side (always parallel with the ground plane), but not up and down. For rotation, it looks like it can rotate side to side and up and down, but not roll. Is that correct?
    18. So I'm running into this problem that I sometimes get little sliver polygons when generating meshes with marching prisms. After thinking about it, it's even possible to get single point triangles. The main issue is when I try to calculate normals for such triangles, it's basically inaccurate or sometimes even impossible. I came up with this idea (which I'm sure it's not new) of simply collapsing one edge of any triangle where this happens. This would necessarily destroy the triangles on the other side of the edge as follows: I think this should work OK but before implementing it I was wondering if there was some other standard way of doing this, especially when dealing with marching cubes or algorithms of that nature.
    19. dpadam450

      Distance Fields

      I briefly looked at some of the material, what I'm wondering is for a screen-space pixel: How does a pixel determine what distance field volumes are overlapping it that need to be raycasted against for doing AO? Does it have reference to all DistanceField volumes and is doing a computer shader with a BSP tree or something?
    20. ASBai

      Add a callback for the GarbageCollect API

      Hi, Andreas Has this callback been added? I remember it has been added, but I didn't find it in the manual. Thanks :-)
    21. Samurai Warrior for FUSE The pack contains the following Clothing items, that you can easily alter the material type, substance, and colour. Check out the Promo Pics on this product page, which depicts the clothing. The Pack contains: Helmet Mask NeckArmour ShoulderArmour Gauntlets Tabbard Belt Trousers Torso Armour Thigh Guards Shin Armour Shoes Hat Decoration Pack can be purchased for just $19 from the below Arteria3d Store Page https://arteria3d.myshopify.com/products/samurai-warrior-for-fuse
    22. davejones

      Keep object in camera view

      I want the camera to be kept within a certain area in 3D space so that when its it can't infinity move out of view of the target object.
    23. Wishing your wife the best. Great update!
    24. Rutin

      Advice for Creating a Hand Drawn 2D RPG

      You would need to figure out your tile size then make a variety of versions which are seamless otherwise the edges wont match up when tiled. Some tiles can be just a sidewalk, road, or grass, others will need to have grass edges or road, ect... and keep in mind you need to consider all directions and corners. This is a tile map example:
    25. Kryzon

      Keep object in camera view

      Unity's Tanks demo has a self adjusting camera. WebGL demo: https://webassembly.org/demo/ Camera code: https://unity3d.com/learn/tutorials/projects/tanks-tutorial/camera-control?playlist=20081
    26. Rutin

      C# variable name creates error

      This is because in C# you are not allowed to start variable names with numbers. Change it to something else like: game_3D_pressed; Because the compiler could confuse it with a numeric literal.
  • Advertisement
×

Important Information

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

We are the game development community.

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

Sign me up!