Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> large amount of objects causing game to lag, gamemaker help
Unspecified
mr.mario
Posted: Jul 7 2009, 04:44 PM
Quote Post


and you people thought Mugen coded in GML would never work
[*][*][*]

Group Icon
Group: Members
Posts: 4755
Member No.: 2349
Joined: 17-July 06

Status: (0d) [--]


okay, I'm making a custom guitar hero game and each note is an object, I've made a program that simulates sheet music where I place notes on a staff and when I'm done it is outputed to a text file contaning GML telling the game where to put notes, the thing is, if theres alot of notes gamemaker will lag, if this were a normal game I'd just deactivate the notes that aren't on screen, but seeing how that isn't in option (if they were deactivated they would stop moving down, never appear on screen, and never be played) so is there an alternative to deactivating objects that makes the game run faster, I wouldn't think so but I thought I'd ask


--------------------
mr.mario's emulated music engine(gamemaker)http://archive.mfgg.net/index.php?showtopic=214636here

Gmugen: here
PMEmail Poster
Top
United States
Xgoff
Posted: Jul 7 2009, 05:10 PM
Quote Post


<):|
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 52341
Member No.: 24
Joined: 13-October 03

Status: (0d) [--]


don't use so many objects?

just create/destroy them on the fly


--------------------

This post may contain original research or unverified claims.
Please disregard the above information and contact an administrator.

DISCLAIMER: by sending me (xgoff) a private message, you agree to the directives and their terms specified henceforth:
DIRECTIVE 1 (APPLE): i may or may not reply promptly or at all; and there are no guarantees to the usefulness of the reply. i may not acknowledge whether i have even received your private message
DIRECTIVE 2 (CHILE CON CARNE): as per my view, "private" applies only to the initial transaction, and the material of your message may or may not be made public at my discretion; as this will more than likely be a post in the CCC or IRC, you may not be able to view it
DIRECTIVE 3 (FEATHER DUSTER): you must address me (xgoff) as "Sir Master Xgofficus his Highest and Most Awesome the Third"; failure to comply with this term may invoke one or both of the above directives, and i will leave a burning bag of **** on your doorstep
DIRECTIVE 4 (BOOTSTRAP): if you have read this disclaimer, please private message me promptly, in compliance with the above terms, so i can ensure you are capable of following directions you idiot
this concludes the test of the emergency disclaimer system, your scheduled programming will now continue. satisfaction guaranteed, and 100% cash back available under certain circumstances; restrictions may or may not apply within your place of residence
NOTICE: these directives and their terms may change at any time, without notice; as a private message transaction to myself assumes an understanding and full compliance of the above, you should ensure you are fully aware of the above terms at any point before sending a private message; any message received is assumed to have been sent in compliance with the above

QUOTE
(5:25:58 PM) Mikau: xgoff
(5:26:00 PM) Mikau: guess what
(5:26:04 PM) Xgoff: chicken butt
(5:26:09 PM) Mikau: **** you
PMEmail PosterUsers WebsiteAOLMSN
Top
Denmark
Mecha the Slag
Posted: Jul 7 2009, 05:50 PM
Quote Post


http://mechaware.net
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 11816
Member No.: 728
Joined: 15-December 04

Status: (0d) [--]


QUOTE (Xgoff @ Jul 8 2009, 12:10 AM)
don't use so many objects?

just create/destroy them on the fly

this is a pretty good general thumb-rule


--------------------




MechaWare GamesMechaSourceMechaWare for CellphonesMechaWare on Steam

PMUsers WebsiteMSN
Top
Unspecified
mr.mario
Posted: Jul 7 2009, 06:12 PM
Quote Post


and you people thought Mugen coded in GML would never work
[*][*][*]

Group Icon
Group: Members
Posts: 4755
Member No.: 2349
Joined: 17-July 06

Status: (0d) [--]


QUOTE (Xgoff @ Jul 7 2009, 05:10 PM)
don't use so many objects?

just create/destroy them on the fly

its guitar hero, less object means less notes, and destroying/creating means I have to rig every not onto a timelines, which is a big fat pain in the but, I guess this means I just have to trash it and start over from the ground up cool.gif


--------------------
mr.mario's emulated music engine(gamemaker)http://archive.mfgg.net/index.php?showtopic=214636here

Gmugen: here
PMEmail Poster
Top
United States
Xgoff
Posted: Jul 7 2009, 06:18 PM
Quote Post


<):|
[*][*][*][*][*]
[*][*]

Group Icon
Group: Members
Posts: 52341
Member No.: 24
Joined: 13-October 03

Status: (0d) [--]


QUOTE (mr.mario @ Jul 7 2009, 05:12 PM)
its guitar hero, less object means less notes, and destroying/creating means I have to rig every not onto a timelines, which is a big fat pain in the but, I guess this means I just have to trash it and start over from the ground up :shifty:

uh no the goal is to just have only the objects needing to be visible at any moment exist

i don't think guitar hero would need more than 50

really if you're doing something like guitar hero, you shouldn't be relying on gm's built-in timing since any sort of lag will probably screw it up (guessing here)

i wouldn't be surprised if the official guitar hero games either use a custom sound format or a container format that tells the engine to create a note when it reaches a specific byte in the sound file (offset of course so the notes reach the bottom of the screen just in time for the music); something like that's harder to set up but it pretty much guarantees it'll be in sync


--------------------

This post may contain original research or unverified claims.
Please disregard the above information and contact an administrator.

DISCLAIMER: by sending me (xgoff) a private message, you agree to the directives and their terms specified henceforth:
DIRECTIVE 1 (APPLE): i may or may not reply promptly or at all; and there are no guarantees to the usefulness of the reply. i may not acknowledge whether i have even received your private message
DIRECTIVE 2 (CHILE CON CARNE): as per my view, "private" applies only to the initial transaction, and the material of your message may or may not be made public at my discretion; as this will more than likely be a post in the CCC or IRC, you may not be able to view it
DIRECTIVE 3 (FEATHER DUSTER): you must address me (xgoff) as "Sir Master Xgofficus his Highest and Most Awesome the Third"; failure to comply with this term may invoke one or both of the above directives, and i will leave a burning bag of **** on your doorstep
DIRECTIVE 4 (BOOTSTRAP): if you have read this disclaimer, please private message me promptly, in compliance with the above terms, so i can ensure you are capable of following directions you idiot
this concludes the test of the emergency disclaimer system, your scheduled programming will now continue. satisfaction guaranteed, and 100% cash back available under certain circumstances; restrictions may or may not apply within your place of residence
NOTICE: these directives and their terms may change at any time, without notice; as a private message transaction to myself assumes an understanding and full compliance of the above, you should ensure you are fully aware of the above terms at any point before sending a private message; any message received is assumed to have been sent in compliance with the above

QUOTE
(5:25:58 PM) Mikau: xgoff
(5:26:00 PM) Mikau: guess what
(5:26:04 PM) Xgoff: chicken butt
(5:26:09 PM) Mikau: **** you
PMEmail PosterUsers WebsiteAOLMSN
Top
Unspecified
mr.mario
Posted: Jul 7 2009, 07:39 PM
Quote Post


and you people thought Mugen coded in GML would never work
[*][*][*]

Group Icon
Group: Members
Posts: 4755
Member No.: 2349
Joined: 17-July 06

Status: (0d) [--]


they way I got it set up every single note exists but only the notes on the guitar are visible, its not a very good system, so I'm gonna have to replace it, I'm gonna have to probably work on the byte thing, I'm using the saudio dll for the sound and it has byte functions, so that will work


--------------------
mr.mario's emulated music engine(gamemaker)http://archive.mfgg.net/index.php?showtopic=214636here

Gmugen: here
PMEmail Poster
Top
Canada
Mailas
Posted: Jul 8 2009, 02:59 AM
Quote Post


Standard Member


Group Icon
Group: Members
Posts: 39
Member No.: 6375
Joined: 8-July 09

Status: (0d) [--]


My suggestion is when something goes out of your view (assuming you're using a view), make it invisible, destroy it, or just don't run any code for it.


--------------------
Goomba Online is: user posted image
user posted image
user posted image
user posted image
PMEmail Poster
Top
Finland
Ultramario
Posted: Jul 8 2009, 05:24 AM
Quote Post


Dan Dan Dan!
[*][*][*][*][*]


Group Icon
Group: Members
Posts: 11240
Member No.: 2164
Joined: 9-June 06

Status: (0d) [--]


Use Time Lines with Xgoff's advice.


--------------------
PMEmail PosterUsers WebsiteAOL
Top
United States
RetroXYZ
Posted: Jul 8 2009, 06:47 AM
Quote Post


Standard Member
[*][*]

Group Icon
Group: Members
Posts: 2714
Member No.: 4325
Joined: 27-August 07

Status: (0d) [--]


You don't need a separate instance for each note. Try using arrays.
PMEmail PosterMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0559 ]   [ 16 queries used ]   [ GZIP Enabled ]   [ Server Load: 1.30 ]