Questions tagged [objects]
A related set of properties (height, colour, level) and methods (pick up item, jump, attack) that are used to describe an entity in the game.
113 questions
1
vote
1
answer
107
views
Efficiently passing data to the GPU corresponding to a collection of objects
I am beginning to work on a physics system, where there are multiple objects in the world that get rendered. The current approach I am considering consists of pseudo-OOP in C where each object has ...
3
votes
2
answers
2k
views
In an object-oriented game engine, should there be seperate classes for objects with and without parents?
I am developing a game engine in C++ (for an idea of what kind of design I'm going for, think of ROBLOX, if you're familiar with that) and I need help with a problem I have.
So basically, the objects ...
0
votes
1
answer
700
views
Why does assigning an empty delegate to this Unity Event Action on construction make it work? (But it is dead/broken without it?)
I am learning about Actions/Events in Unity and just built a system around them which works. However, it seems I just got lucky and I'm not sure why.
Roughly, my class in a simple illustrative form (...
1
vote
0
answers
2k
views
Unreal Engine 4.26: How to serialize and load the array of custom UObjects (TArray<UObject*>) in C++?
I have a UProperty in struct which is a TArray<UCoverInfo*> where UCoverInfo is inherited from UObject:
...
-1
votes
1
answer
673
views
Create list of objects with a for loop pygame/python
Hi everyone I am trying to make a Mahjong Solitaire game using pygame.
I want to create a list of objects (the tiles of the game) using a for loop, but I can't manage to set a different type (the ...
0
votes
1
answer
111
views
Painter's theorem inside and outside test [closed]
I have read from Hearn and Baker computer graphics book. I read the test#2 painter's theorem which image is given below.
This image showing surface S is completely behind the surface S', by checking ...
1
vote
1
answer
146
views
Calculate coordinates of boundaries containing group of objects
I would like to understand how to calculate coordinates of boundaries group of objects as a parallelepiped in 3D game?
Let's say for simplicity we have spheres randomly slowly moving in 3d space some ...
0
votes
1
answer
165
views
How to deal with data that needs to be accessed by all objects?
I have a World class that currently only has one instance. It has data and methods that need to be accessed by all other game objects. Right now I'm hardcoding a ...
3
votes
2
answers
367
views
Given a base class and many derived classes with additional features, what's the best practice for accessing those features?
This might sound strange, but let me explain. Say I want to write a safari program.
In this safari there is an object pool of 10 animals (Animal*): 2 ostrich, 5 ...
0
votes
1
answer
85
views
Ideal way to instantiate abilities in a class give a dynamic list of abilities to use?
I have a PlayerClass class that is used to set my Player's class. For instance, this will make him a warrior:
PlayerClass warrior = new WarriorClass();
...
0
votes
1
answer
159
views
How to differentiate between object types and roles?
I have a base class Object, and depending on how the object must behave on the scene, I have multiple abstract "role" classes, that inherits virtually from ...
0
votes
0
answers
53
views
Efficient system to reach the "parent" variable
I've been stuck doing this in a very inefficient way and really want to know if there's some design pattern that solves this because it seems like a pretty common problem to have.
I have a system ...
0
votes
0
answers
22
views
Scrollable Text On Object
I want to put Scrollable Text On Object / Mesh.
I looked after it on YT but I did not find anything useful.
How could I do this?
1
vote
1
answer
185
views
Wonky perlin noise
I am quite new to the wondrous world of "Procedural Textures", and I am trying to create a double precission perlin noise algorithm.
I am almost done with it except for the fact that the coordinates ...
0
votes
2
answers
491
views
Querying game objects in real-time
I'm thinking about working on a game where I need to find all the objects matching certain properties.
For instances I might need to look up all the objects...
Producing gold.
Whose level is 5 or ...
0
votes
1
answer
238
views
Why has my object detached itself from the parent?
I made an two objects in blender, animated them, and saved them.
Firstly, when I reloaded them, half of the animations I created had disappeared, which is annoying itself but the real annoyance is ...
0
votes
1
answer
1k
views
C++:Segmentation fault (core dumped) while creating gameobject
i made a small code to debug and i get this error
player inherit from gameobject
code
...
0
votes
1
answer
391
views
C++: passing gameobject as a parameter and then into vector
firstly iam used to java and new to c++ so maybe this will looks a noob's question
i will explain this and give a pseudo code and then c++ just so you can understand me
i have a player class which ...
1
vote
1
answer
228
views
Can I put real monuments like white house, statue of liberty in my open world game? [duplicate]
I'm currently working on open world game. But I am confused about one thing that, is it ok if I put real monuments and sculptures like white house, statue of liberty etc. in my game? Please help if ...
0
votes
2
answers
119
views
Can a character interact well with surroundings in-game?
I don't have any experience in game programming, but I am currently on programming-related degree, although on a different branch to game design.
I thought about how an environment can come more ...
1
vote
1
answer
104
views
How to set keys for emission on/off for a prefab?
I am making a prototype for a Mario game and am having difficulty completing a canned animation for a prefab. There is an item box asset that has 3 materials and an "ItemGet" animation. One of these ...
0
votes
1
answer
124
views
Prevent Wall Clipping with Bouncing Shape
I'm currently working on a demo-type program involving bouncing objects. Currently, I have a rectangle that can bounce around the screen.
When the rectangle bounces against one of the walls ...
0
votes
0
answers
15
views
NullReferenceException: Object reference not set to an instance of an object [duplicate]
Hi so im displaying food, health an water on the screen in a text box by using UnityEngine.UI and making text variables. They are all defined in the update function so they will keep changing and are ...
2
votes
2
answers
4k
views
C++ create array of multiple types
I tried to create an array Entity[] with elements Human and Zomby.
...
2
votes
1
answer
1k
views
Instantiating a GameObject at my desired position not working
I'm sure I am misunderstanding something about Unity vectors or something here. I am brand, brand new to Unity so this is part of the problem.
I am trying to make a simple atomic model and I am ...
0
votes
1
answer
2k
views
Read access violation, pointer was nullprt
Im trying to figure out how to use pointers to make a single instance of an object that in this example will just change direction on x-axis.
Splav.h (eng. Paddle.h)
...
0
votes
1
answer
1k
views
Sprite/Object/Room limits in GameMaker 8.1?
I know about GameMaker Studio’s limitations for sprites, objects, rooms, and other assets (https://help.yoyogames.com/hc/en-us/articles/230407528-GameMaker-Studio-2-Trial-Limitations), but I can’t ...
1
vote
1
answer
5k
views
Unity2D: Vector3.Lerp - smooth movement
I have a script that randomly chooses a position to move a game object every 5 seconds, however instead of moving my object smoothly, my script make my object jumps, which is not desirable! How would ...
0
votes
0
answers
146
views
Make a object render behind/trough another but make hide it if its behind some other object
So first of all sorry for this strange title...
I know it may sounds worse and a bit complicated...
But heres my problem :
My player belongs to the "Player" layer.
He stands somewhere on my map, ...
0
votes
2
answers
100
views
Equal objects with independent variables in Game Maker?
Think of a situation with two distinct runners with different speeds. They will have to walk a circuit in a straight line with two obstacles (police).
Below is an illustration of the situation:
The ...
1
vote
1
answer
622
views
LIBGDX - group as child of an actor?
I've looked in forums, the doc, and the code, and I'm thinking this isn't currently possible, but maybe I'm missing something, so just to be sure: is there a way to set a group as child of and actor? ...
1
vote
1
answer
1k
views
Difference between Object.Destroy() and GameObject.Destroy() in Unity
What is the difference between using Object.Destroy() and GameObject.Destroy() in Unity?
I found the following info about that: ...
0
votes
1
answer
118
views
Make character move behind object
I used Tiled Editor for making maps for my own game, I do not run any engine or anything. I have separated terrain layer and object layer in TiledEditor.
However I have problem with trees I want to ...
1
vote
1
answer
168
views
Evenly distribution of 2 or more shapes given their x and y points inside a bounding box
I have a set of dynamically shaped objects, How do I distribute them evenly either Horizontally or Vertically.The objects are surrounded by a bounding box and the objects are placed at x,y as shown.
...
0
votes
1
answer
3k
views
Cannot implicitly convert type object[] to UnityEngine.GameObject[]
So, I cannot implicitly convert type object[] to UnityEngine.GameObject[]. But why? As far I know, are all types a inheritanced types of object. So, for my logic, I could put a GameObject array in a ...
0
votes
0
answers
201
views
Best strategy to track object hierarchy using groups and obj files
I am making a 3D game in OpenGL from scratch. In this game I have a ship with stuff inside it. How can I attach the stuff to the ship in the CAD program and maintain that hierarchy in my own game?
...
2
votes
0
answers
474
views
How to make sure two Tiles not overlap each other?
I'm trying to make a Grid who will be easily convertible between 2D and 3D and I'm having a problem with overlapping prefabs in the case of the 3D generation.
The thing is, the DataObjects (Tiles) ...
-1
votes
1
answer
67
views
How to detect when object A In point B place
i have object which is moving to points in the screen each time the point ( call it B)
is moving to different place and object A follow its direction .
Im using Linear interpolation and simple ...
1
vote
1
answer
1k
views
How to prevent clicking through object in GameMaker
I've been making my first, simple game in Game Maker. You have to click a moving ball (obj_ball), each time you click it, it wil start moving faster. I wanted to add a way to lose the game: if you ...
0
votes
1
answer
220
views
A logic error. canvas: balls physics, bounce
Hi I was making a program that simulate a bunch of balls bouncing, but the problem is some balls got stuck to the floor. Since it's a logic error, it is kind of difficult to find. Can someone help, I ...
0
votes
1
answer
92
views
Tree of objects in 2D space - children relative to parent
Question
How do we track the position of child objects, relative to a parent?
Context
I have a simple structure that keeps track of a point in space, along with zero or more children:
...
0
votes
1
answer
113
views
Identify objects of the same type from each other, even between game restarts?
So I have a simple Character class:
...
0
votes
1
answer
341
views
How to add a JSON object / model into your whitestorm world / scene?
I am loading the object from my json file.
...
0
votes
2
answers
179
views
How do I pass my objects to the update method?
I've had formal education in Java for around half a year now, and as a hobby I would like to attempt game development. I've downloaded the Slick2d library to help with this.
I've run into a problem ...
0
votes
1
answer
6k
views
How to have random and different colors on multiple objects with one material?
I want to have one material applied to multiple objects that has a random color on each object. How can I achieve this so that I don't need to use a different material for every object? This is in ...
1
vote
1
answer
5k
views
GameStudio : How to remove object after delay
When you pick an item in the inventory and drop it to obj_item_ground, this item is send to the ground. That's fine.
I want to add a delay to this item to destroy ...
3
votes
2
answers
7k
views
C++ Instantiating objects as function arguments / parameters (base and derived classes)
I've noticed with some functions in C++ that accept objects (e.g. constructors), you can actually create the object within the function argument e.g. (this example uses an SDL_Point as the main ...
1
vote
2
answers
161
views
Change parent object on instantiation
I'm making a game in which I have different weapons. One of them is a hand grenade. Well, the question is:
I made an animation with mecanim (I don't know if is the correct way) with the grenade being ...
12
votes
1
answer
2k
views
How to randomly place entities that don't overlap?
I am creating a randomly-generated environment for a game I'm developing. I am using OpenGL and coding in Java.
I am trying to ...
1
vote
1
answer
1k
views
Game asset "objects" consisting of several meshes vs continuous mesh
When building game objects in a 3D modeler like Blender I'm finding it's easier to get greater detail and still have fewer vertices if I separate certain elements. For example, I need to make cuts ...