Aleph One 1.3b3

Have a question, suggestion, or comment about Aleph One's features and functionality (Lua, MML, the engine itself, etc)? Post such topics here.
User avatar
Wrkncacnter
Vidmaster
Posts: 1953
Joined: Jan 29th '06, 03:51
Contact:

I don't remember working on anything like that, so you must be thinking of someone else. If it's based on what player is in what kind of media, then you don't have to pass information around, just detect where the players are.

The most you could do to pass information is to have one player tap the mic key 5 times in quick succession, and you could detect that and disable precipitation or something stupid like that.
User avatar
The Man
Vidmaster
Posts: 1203
Joined: Aug 6th '08, 05:23
Location: Sarasota, FL
Contact:

I thought she said you helped her with it, but I might’ve misremembered.

I added an edit to my last post while you were writing that one that you might’ve missed because it’s now on the previous page, so I’ll bring it over to this one (with a couple of addenda and clarifications):
I’m thinking in Triggers.init():

Code: Select all

gameticks = 0
userain = 1
then in Triggers.idle() (note that this is not actual Lua):

Code: Select all

if setting = false then userain = 0
gameticks = gameticks + 1
and then once gameticks reaches a certain count, it makes a decision on whether or not to use start using the rain scripts based on the value of userain. (It wouldn’t start executing the rain script until that number of ticks elapses.) Would look weird when it sets in but whatever.
“People should not be afraid of their governments. Governments should be afraid of their people.” —V, V for Vendetta (Alan Moore)

“The trouble is that we have a bad habit, encouraged by pedants and sophisticates, of considering happiness as something rather stupid. Only pain is intellectual, only evil interesting. This is the treason of the artist: a refusal to admit the banality of evil and the terrible boredom of pain. If you can’t lick ’em, join ’em. If it hurts, repeat it. But to praise despair is to condemn delight, to embrace violence is to lose hold of everything else. We have almost lost hold; we can no longer describe happy man, nor make any celebration of joy.” —Ursula K. Le Guin, “The Ones Who Walk Away from Omelas”

“If others had not been foolish, we should be so.” —William Blake, The Marriage of Heaven and Hell

“The law cannot protect anyone unless it binds everyone; and it cannot bind anyone unless it protects everyone.” —Frank Wilhoit

Last.fm · Marathon Chronicles · Marathon Eternal 1.2 · Where Monsters Are in Dreams · YouTube Vidmaster’s Challenge
User avatar
Wrkncacnter
Vidmaster
Posts: 1953
Joined: Jan 29th '06, 03:51
Contact:

That's not how it works. Variables don't get shared across netgames.

Maybe I helped her with some specific issue she was having with it, I don't know. The overall concept of the script never made any sense to me, so I don't even know what it does.

Also changing the fog to different colors based on the local player doesn't seem like the type of thing that would cause OOS anyway. I think If I were worried about fog color based on media, I'd just change it for the local player and not worry about anyone else.
User avatar
The Man
Vidmaster
Posts: 1203
Joined: Aug 6th '08, 05:23
Location: Sarasota, FL
Contact:

The script changes the value of the fog depending upon what player has last entered/exited media, as I understand it. Is the value of the fog not actually shared across netgames between players either? If it is shared between players, perhaps that could be substituted as some sort of kludge to indicate players' settings without actually having to pass variables across machines. (The value could be some imperceptible difference that players wouldn't notice but computers would, like 0.001 for RGB values versus 0.) If it isn't shared across machines, I guess the whole thing was pointless.

An inevitable follow-up question is: if values aren't shared across computers, do players have the same value on every computer in a network game? That is, is Players[0] (or whatever; I haven't looked up the Lua guide in awhile) always the gathering player? If so, that could perhaps be used to decide whether to run the fog script - that is, if Players[0] weren't the player, then the rain script wouldn't run, and if Players[0] were the player, then the rain script would only run depending upon settings. However, if Players[0] is always the local player's machine rather than the gatherer's machine, that's obviously not going to fly either. (This might not make complete sense to anyone else, as I'm not certain I've described it in a way that makes perfect sense to me, either; so if it is, sorry, and I'll try again later when my mind is clearer.)

IDK; just throwing out ideas. Probably easiest just to disable in net games; but it would be a shame, because it looks cool.

ETA: oh, what about making a dummy object when the game starts (with unique properties not used by any other object in the map, such that the script knows it's the object in question); each player's Triggers.idle() deletes it if it's there and they have the rain plugin disabled; after a certain number of ticks elapses, if the dummy object is still there, the rain script executes? Would that work or would it cause crashes from multiple players trying to delete the same object or something?

...also, this is getting fairly off-topic, so again, I'm not bothered if someone wants to split it. Sorry for the digression.
“People should not be afraid of their governments. Governments should be afraid of their people.” —V, V for Vendetta (Alan Moore)

“The trouble is that we have a bad habit, encouraged by pedants and sophisticates, of considering happiness as something rather stupid. Only pain is intellectual, only evil interesting. This is the treason of the artist: a refusal to admit the banality of evil and the terrible boredom of pain. If you can’t lick ’em, join ’em. If it hurts, repeat it. But to praise despair is to condemn delight, to embrace violence is to lose hold of everything else. We have almost lost hold; we can no longer describe happy man, nor make any celebration of joy.” —Ursula K. Le Guin, “The Ones Who Walk Away from Omelas”

“If others had not been foolish, we should be so.” —William Blake, The Marriage of Heaven and Hell

“The law cannot protect anyone unless it binds everyone; and it cannot bind anyone unless it protects everyone.” —Frank Wilhoit

Last.fm · Marathon Chronicles · Marathon Eternal 1.2 · Where Monsters Are in Dreams · YouTube Vidmaster’s Challenge
User avatar
Wrkncacnter
Vidmaster
Posts: 1953
Joined: Jan 29th '06, 03:51
Contact:

Nothing in lua is shared across the network. For example if you had this code:

if Players.local_player.name == "Aaron" then
Level.fog.color = whatever
end

It will only turn the Fog color for you to whatever. Everyone else's fog will remain the same as it was before. This is why there's a warning in the docs saying you probably shouldn't use local_player, because Lua relies on everything being executed the same across everyone's machines (although in the case of fog color, I can't imagine how that would cause OOS).

Players[0] will always point to the gatherer, or at least it'll always be the same person consistently for everyone.

I can't tell what you're talking about in your second paragraph, but I'm certain whatever you're thinking won't work.
User avatar
The Man
Vidmaster
Posts: 1203
Joined: Aug 6th '08, 05:23
Location: Sarasota, FL
Contact:

Yeah, I was afraid my explanation in my second paragraph might've been incoherent. Basically, my idea was to have an if-then statement running lolrain() if and only if the player is Players[0] and the rain plugin is enabled. Would that not update the same scenery objects on everyone else's computer? If not, then this is wildly off-base. I assumed that the game would want to keep objects consistent across machines when they are altered by Lua, because their existence or nonexistence would almost certainly cause games to desync quickly - they're not trivial things like fog colour.

Also I guess I can just let mediafog() execute in net games in Chronicles now, so that's good to know. I was afraid it would end up incredibly seizure-inducing if I let it execute in net games, but I was just assuming it would pass the fog values between machines - I don't think I'd seen anything to suggest otherwise.
“People should not be afraid of their governments. Governments should be afraid of their people.” —V, V for Vendetta (Alan Moore)

“The trouble is that we have a bad habit, encouraged by pedants and sophisticates, of considering happiness as something rather stupid. Only pain is intellectual, only evil interesting. This is the treason of the artist: a refusal to admit the banality of evil and the terrible boredom of pain. If you can’t lick ’em, join ’em. If it hurts, repeat it. But to praise despair is to condemn delight, to embrace violence is to lose hold of everything else. We have almost lost hold; we can no longer describe happy man, nor make any celebration of joy.” —Ursula K. Le Guin, “The Ones Who Walk Away from Omelas”

“If others had not been foolish, we should be so.” —William Blake, The Marriage of Heaven and Hell

“The law cannot protect anyone unless it binds everyone; and it cannot bind anyone unless it protects everyone.” —Frank Wilhoit

Last.fm · Marathon Chronicles · Marathon Eternal 1.2 · Where Monsters Are in Dreams · YouTube Vidmaster’s Challenge
User avatar
Wrkncacnter
Vidmaster
Posts: 1953
Joined: Jan 29th '06, 03:51
Contact:

If the logic to enable rain is that the local player is the gatherer, and they have the plugin enabled, then the gatherer will get rain and no one else will. This is how you get OOS.
User avatar
The Man
Vidmaster
Posts: 1203
Joined: Aug 6th '08, 05:23
Location: Sarasota, FL
Contact:

So just to confirm: the object deletion function in Lua doesn't delete objects for every player in a network game; it only deletes objects for the local player? That seems really counter-intuitive, but OK.

I think part of the problem is that I must've been misunderstanding this whole time how Lua scripts even work in network games, and thinking about it more now is actually just giving me a headache. I would think many of them must affect objects in some fashion, and it seems unlikely that they can instantaneously know what other players' scripts have done until at least a few game ticks later. This is some wibbly-wobbly time travel shit the more I think about it. I assume the scripts must depend upon everyone's machine running the exact same code in order not to desync, at least if I'm now understanding their functionality correctly, but they obviously have to compensate for lag in some fashion, and there must be a whole ton of stuff going on in the backend that I just never thought about before.

It's also possible I've just been assuming embedded Lua and netscripts work the same way, and they obviously must not. Would it perhaps be possible to split the precipitation effects for network games off to a netscript that the gatherer could enable (or not) as desired? The netscript automatically gets sent to everyone's box, correct? So the variable to enable rain for network games could just get passed that way, unless I've got this wrong.
“People should not be afraid of their governments. Governments should be afraid of their people.” —V, V for Vendetta (Alan Moore)

“The trouble is that we have a bad habit, encouraged by pedants and sophisticates, of considering happiness as something rather stupid. Only pain is intellectual, only evil interesting. This is the treason of the artist: a refusal to admit the banality of evil and the terrible boredom of pain. If you can’t lick ’em, join ’em. If it hurts, repeat it. But to praise despair is to condemn delight, to embrace violence is to lose hold of everything else. We have almost lost hold; we can no longer describe happy man, nor make any celebration of joy.” —Ursula K. Le Guin, “The Ones Who Walk Away from Omelas”

“If others had not been foolish, we should be so.” —William Blake, The Marriage of Heaven and Hell

“The law cannot protect anyone unless it binds everyone; and it cannot bind anyone unless it protects everyone.” —Frank Wilhoit

Last.fm · Marathon Chronicles · Marathon Eternal 1.2 · Where Monsters Are in Dreams · YouTube Vidmaster’s Challenge
User avatar
Wrkncacnter
Vidmaster
Posts: 1953
Joined: Jan 29th '06, 03:51
Contact:

Actually yeah, your netscript idea would work. A plugin to set one variable to indicate it's on. It would only get used if the number of players is 1. A second variable that is set by a netscript, and it only gets used if there are multiple people in the game.
User avatar
ravenshining
Vidmaster
Posts: 892
Joined: Jun 17th '17, 22:50
Location: Hawai'i

The media fog script I wrote changes fog globally depending on what media players are under, and will sometime show a player the wrong colour fog. It's not a plugin, so the same code is executed on everyone's machine, and relys on information in the world that is consistent for everyone. If it were dependent on a plugin, then not everyone is executing the same code, therefore not everyone's world will be the same, and the game would go out of sync.

Otherwise, if it were possible for one player to execute a bit of code no-one else has, and then pass that information to other players, then people could use cheat scripts in netgames, and we don't want that. To pass information legally, you'd need some sort of meta-script that forces you to take an action that other players can "see" and could do themselves - for example, hit the action key seven times in rapid succession upon spawning in, or type something into the chat - like a bot. AFAIK no-one has made player bots for A1.

EDIT: It appears Lua can print to chat, but not read chat. If it could read chat, then you could do something like wait for someone to type, "turn the rain off," and then turn off the rain.

EDIT2: I think I remember walking Narcogen and Blackstar through a chat command to teleport when they got stuck on a Rubicon level, and it working. So, maybe you just need a function to shut the rain off, and instruct players to call it if rain is causing them FPS prahblums.
User avatar
Wrkncacnter
Vidmaster
Posts: 1953
Joined: Jan 29th '06, 03:51
Contact:

ravenshining wrote:The media fog script I wrote changes fog globally depending on what media players are under, and will sometime show a player the wrong colour fog.
Sounds like a lot of work for a bad result, then.
ravenshining wrote:If it were dependent on a plugin, then not everyone is executing the same code, therefore not everyone's world will be the same, and the game would go out of sync.
Not sure what's going on with this sentence. If you're saying that using a plugin to handle fog in the context of a netgame would be stupid, then yes, I agree. I'm still not convinced changing fog color will cause anything to go out of sync though, so I'm not sure what you said is actually correct in the context of media fog.

I also don't think solo lua in a plugin is even run in a netgame, so thinking about this is irrelevant.

I'm not sure what's going on in the rest of your post, so I have nothing to say there.
User avatar
ravenshining
Vidmaster
Posts: 892
Joined: Jun 17th '17, 22:50
Location: Hawai'i

Wrkncacnter wrote:Sounds like a lot of work for a bad result, then.
It worked great in our tests, especially if players stick together. It only show the wrong colour to a person when someone else is already swimming in a different liquid. That's better than having it be static and always showing the wrong colour in one liquid, or showing a compromised colour in all liquids. It also prevents the colour from changing while one is swimming, which would look terrible.
Wrkncacnter wrote:I'm not sure what's going on in the rest of your post, so I have nothing to say there.
There were a lot of posts between when I started writing and when I finished. Aaron asked about my fog script, thinking it was a case of lua passing information between players, so I clarified that it doesn't do that. Then I addressed in general the topic at hand- passing information between players: why it doesn't work, why it shouldn't work, and ways around it.
User avatar
Wrkncacnter
Vidmaster
Posts: 1953
Joined: Jan 29th '06, 03:51
Contact:

Not that it probably matters, but is there a reason not to just set the fog color for the local player based on what liquid they happen to be in? Then everyone will see the color they're supposed to.
User avatar
treellama
Vidmaster
Posts: 6110
Joined: Jun 2nd '06, 02:05
Location: Pittsburgh
Contact:

Wrkncacnter wrote:
The Man wrote: As to precipitation, is there a way to make Lua execution (1) dependent upon a plugin (2) that only executes in specific levels?
I know I've told Eternal devs exactly how to do this before, but it requires AlephOne 1.3.
Before 1.3, you could use Annotations. :C

Anyway, yes, in the plugin just set a stash key that says to enable precipitation, then in the level embedded script check (once) to see if that stash key exists and if it doesn't, erase the precipitation triggers. In network games, precipitation will be off which is a safe default. Again, this is fairly ugly, and should be a last resort.

As for the rest of this thread: I don't really know what's going on other than a lot of misunderstanding of Lua, which is probably better cleared up in a separate thread. It's safe to enable fog on local player, since that's a graphics preferences option anyway. Still, unless you know exactly what you're doing, it's best to avoid local player.
User avatar
Wrkncacnter
Vidmaster
Posts: 1953
Joined: Jan 29th '06, 03:51
Contact:

Annotations wouldn't solve the problem of deleting scenery though. So if you have the plugin enabled, save your game, and then turn it off and reload your game, you'd have a bunch of scenery objects frozen in the air. You still need 1.3 to clean it up.
User avatar
treellama
Vidmaster
Posts: 6110
Joined: Jun 2nd '06, 02:05
Location: Pittsburgh
Contact:

You're using scenery for precipitation? Why not effects?
User avatar
Wrkncacnter
Vidmaster
Posts: 1953
Joined: Jan 29th '06, 03:51
Contact:

I think at this point everyone just uses your precipitation stuff from snowfrog. So the decision to use scenery came from you. I ended up using effects for stuff in aopid instead of scenery, because of the scenery bug. I don't work on Eternal, so I never made any decisions about their precipitation.
User avatar
treellama
Vidmaster
Posts: 6110
Joined: Jun 2nd '06, 02:05
Location: Pittsburgh
Contact:

Snowfrog uses effects.

Edit: no it doesn't. WELL.
User avatar
ravenshining
Vidmaster
Posts: 892
Joined: Jun 17th '17, 22:50
Location: Hawai'i

treellama wrote:You're using scenery for precipitation? Why not effects?
I've been asking the same question!
User avatar
The Man
Vidmaster
Posts: 1203
Joined: Aug 6th '08, 05:23
Location: Sarasota, FL
Contact:

How would one go about converting the scenery in the precipitation script to effects? I should really learn how more of this stuff works. I’ll look into changing it over for Chronicles next month (and Eternal 1.3, if someone else hasn’t gotten around to it first).

I also didn’t realise it was possible to set local fog values, which I will definitely change my scripts to do at some point.
Wrk wrote:Actually yeah, your netscript idea would work. A plugin to set one variable to indicate it's on. It would only get used if the number of players is 1. A second variable that is set by a netscript, and it only gets used if there are multiple people in the game.
Thanks, I was hoping that would be the answer. Upon further reflection, is there really any reason the same script couldn’t be used for both solo and net games? Though I suppose a plugin is more convenient for solo games.

And yeah, if people want to split this to another thread, that’s fine – it’s gotten massively off-topic, but I feel weird starting a new thread that’s mostly responding to posts in this one. LOL
“People should not be afraid of their governments. Governments should be afraid of their people.” —V, V for Vendetta (Alan Moore)

“The trouble is that we have a bad habit, encouraged by pedants and sophisticates, of considering happiness as something rather stupid. Only pain is intellectual, only evil interesting. This is the treason of the artist: a refusal to admit the banality of evil and the terrible boredom of pain. If you can’t lick ’em, join ’em. If it hurts, repeat it. But to praise despair is to condemn delight, to embrace violence is to lose hold of everything else. We have almost lost hold; we can no longer describe happy man, nor make any celebration of joy.” —Ursula K. Le Guin, “The Ones Who Walk Away from Omelas”

“If others had not been foolish, we should be so.” —William Blake, The Marriage of Heaven and Hell

“The law cannot protect anyone unless it binds everyone; and it cannot bind anyone unless it protects everyone.” —Frank Wilhoit

Last.fm · Marathon Chronicles · Marathon Eternal 1.2 · Where Monsters Are in Dreams · YouTube Vidmaster’s Challenge
User avatar
treellama
Vidmaster
Posts: 6110
Joined: Jun 2nd '06, 02:05
Location: Pittsburgh
Contact:

I must have used scenery because it is just slightly lower overhead than effects? I don’t know. Both are a hack :)
User avatar
Pfhorrest
Vidmaster
Posts: 1847
Joined: Oct 12th '07, 22:08
Location: California
Contact:

wouldnt spawning projectiles and letting them fall under their own gravity in the physics be more efficient than manually moving stuff around by script?

im completely lost on all of this, lia and/or aaron are responsible for all the precipitation in eternal
User avatar
Wrkncacnter
Vidmaster
Posts: 1953
Joined: Jan 29th '06, 03:51
Contact:

When I first created a script for precipitation, you couldn't move scenery or effects, so I used projectiles. The only other option would be killing monsters and letting them fall (this caused the radar to be useless).

Apparently projectiles are the least efficient because the engine will have to calculate the collision for each one. You can try loading up WETPEACK to see how bad it is. I do miss how they caused liquids to splash though (even it it didn't always make sense).

@The Man: I was overthinking the netscript before. Since the plugin won't run in a netgame, and the netscript won't be relevant in the single player game, you could use the same script, yeah.
User avatar
The Man
Vidmaster
Posts: 1203
Joined: Aug 6th '08, 05:23
Location: Sarasota, FL
Contact:

Thanks. I thought I said that. Maybe someone took my suggestion and split the off-topic stuff.

Anyway, I just thought of one other, possibly stupid feature request. I see options on my system to run the game in 1200x900, 1600x900, and 1920x1080, but no 4:3 option for 1080p. Is there a way to add an option for 1440x1080? I usually run M2, M∞, Chronicles, and other scenarios that still use the classic HUD with the interface at maximum size, making them functionally 4:3 anyway – this way I wouldn’t be rendering videos for those games with unnecessary black bars at the sides. I suppose some people might like having the 16:9 aspect ratio even though the videos aren’t actually making use of the space at the sides, but I’d rather get rid of them if possible.
“People should not be afraid of their governments. Governments should be afraid of their people.” —V, V for Vendetta (Alan Moore)

“The trouble is that we have a bad habit, encouraged by pedants and sophisticates, of considering happiness as something rather stupid. Only pain is intellectual, only evil interesting. This is the treason of the artist: a refusal to admit the banality of evil and the terrible boredom of pain. If you can’t lick ’em, join ’em. If it hurts, repeat it. But to praise despair is to condemn delight, to embrace violence is to lose hold of everything else. We have almost lost hold; we can no longer describe happy man, nor make any celebration of joy.” —Ursula K. Le Guin, “The Ones Who Walk Away from Omelas”

“If others had not been foolish, we should be so.” —William Blake, The Marriage of Heaven and Hell

“The law cannot protect anyone unless it binds everyone; and it cannot bind anyone unless it protects everyone.” —Frank Wilhoit

Last.fm · Marathon Chronicles · Marathon Eternal 1.2 · Where Monsters Are in Dreams · YouTube Vidmaster’s Challenge
User avatar
ravenshining
Vidmaster
Posts: 892
Joined: Jun 17th '17, 22:50
Location: Hawai'i

While I agree that it would be nice if resolution were more flexible - it's weird how you have have the game full screen with no HUD, or a HUD with black borders, but not display the HUD while filling the remaining space with the world - you can obtain nonstandard resolutions by entering them manually in the preferences file. It may help to run A1 in a window for video rendering if you do this.
Post Reply