Jump to content

Re-Release A27 or RC builds?


Recommended Posts

3 minutes ago, Seleucids said:

Since you mentioned selection, there is something strange I noticed: if I draw the selection area from top left to bottom right, the selection works as usual. However, if I move my cursor from bottom right to top left, I cannot select anything. Not sure if this is related

That sounds like the selection bug of Arch based linux using SDL3 through a compat layer (which is not supported by the game yet)

 

4 minutes ago, Seleucids said:

Although it's to be tested when the area we are drawing over contains many allied and enemy units which will not be added to our controllable selection but nevertheless be considered by the engine.

Do you have evidence for this?

https://code.wildfiregames.com/D1618

 

Link to comment
Share on other sites

 source/simulation2/helpers/selection.cpp:

	for (CSimulation2::InterfaceListUnordered::const_iterator it = ents.begin(); it != ents.end(); ++it)
	{
 		entity_id_t ent = it->first;
		CEntityHandle handle = it->second->GetEntityHandle();

		// Check if this entity is only selectable in Atlas
		if (static_cast<ICmpSelectable*>(it->second)->IsEditorOnly() && !allowEditorSelectables)
			continue;

		if (matchRank)
		{
			// Exact template name matching, optionally also allowing foundations
			const std::string curTemplateName = cmpTemplateManager->GetCurrentTemplateName(ent);
			bool matches = (curTemplateName == templateName ||
				(allowFoundations &&
				std::string_view{curTemplateName}.substr(0, 11) == "foundation|" &&
				std::string_view{curTemplateName}.substr(11) == templateName));
			if (!matches)
				continue;
		}

		// Ignore entities hidden by LOS (or otherwise hidden, e.g. when not IsInWorld)
		// In this case, the checking is done to avoid selecting garrisoned units
		if (cmpRangeManager->GetLosVisibility(handle, owner) == LosVisibility::HIDDEN)
			continue;

		// Ignore entities not owned by 'owner'
		CmpPtr<ICmpOwnership> cmpOwnership(simulation.GetSimContext(), ent);
		if (owner != INVALID_PLAYER && (!cmpOwnership || cmpOwnership->GetOwner() != owner))
			continue;

		// Ignore off screen entities
		if (!includeOffScreen)
		{
 			// Find the current interpolated model position.
			CmpPtr<ICmpVisual> cmpVisual(simulation.GetSimContext(), ent);
			if (!cmpVisual)
				continue;
			CVector3D position = cmpVisual->GetPosition();

			// Reject if it's not on-screen (e.g. it's behind the camera)
			if (!camera.GetFrustum().IsPointVisible(position))
				continue;

If I interpreted this piece of code correctly, it iterates through all entities in the selection zone, then discards entities which are not valid for selection. I think this decision process will take time, even for non-selectable items. 

I stand corrected on this as I don't fully understand how LoS and Cmp work. 

Link to comment
Share on other sites

1 hour ago, Seleucids said:

These large regular spikes are interesting. I don't have them even in large games, which you can see in my earlier comments. I would look more closely but I can't open the jsonp. This is without AI right? Could you zoom in on some of the more regular spikes, including the surrounding ~30 turns?

The full hash checks are not logged so they should show up as gaps, not spikes right?

Link to comment
Share on other sites

17 minutes ago, real_tabasco_sauce said:

These large regular spikes are interesting. I don't have them even in large games, which you can see in my earlier comments. I would look more closely but I can't open the jsonp. This is without AI right? Could you zoom in on some of the more regular spikes, including the surrounding ~30 turns?

The full hash checks are not logged so they should show up as gaps, not spikes right?

nvm, thats a graphical profile right? so then those are just the hash checks

Link to comment
Share on other sites

1 hour ago, real_tabasco_sauce said:

nvm, thats a graphical profile right? so then those are just the hash checks

Yes. I did a bit more of these experiments:

  • Singleplayer is generally very monotone with a single frequency. If there is too much to render then the rendering time for each frame is equally long until units die out. 
  • Even with LAN game, there exists hashes which come in at random intervals and last for quite long compared to render. 
  • Singleplayer experience has almost no stuttering.
  • LAN stutters with large quantities or units or high number of commands issued. The same does not apply for singleplayer, where the fps strongly depends on the number of units and their animation, only. 
Link to comment
Share on other sites

8 hours ago, real_tabasco_sauce said:

With the stutter fix, do you still get unusually low FPS once you reach p3 like u said earlier?

With the stutter "fix", in P3 there is visible delay (between input and GUI response) as soon as the phase 3 tech finishes researching. It's almost magic. 

Frame rate wise, the counter drops from 120fps in P2 to 50-60fps. However, in reality (at least from user perspective), it is nowhere near the 50 fps claimed by the counter. Occasionally the frame rate counter does shop dips to as low as 8fps while building barracks in P3. 

Weird thing is, if I push with large army in P2, the stutter is significantly less and frame rate is high. P3 seems to be the culprit. :confused: 

These graphs illustrate my frame rate experience:

image.thumb.png.7d7f7f7bdc498c297f8674c18db96ab1.png

Multiplayer:

image.thumb.png.9559b2e698b85cdf3b1af241ebe7b474.png

Link to comment
Share on other sites

8 hours ago, real_tabasco_sauce said:

linux users

Is there something special about the Linux kernel that you have noticed, or is it just a coincidence that most people replying to this thread are Linux users?

I have tried to play A26 on Windows 11, with Atlas playbook. The frame rate on Windows was on average 70% of my Linux values but generally more stable. The CachyOS kernel always pushes for the highest frame rate possible so the fps is somewhat uneven.

Vulkan only deteriorates performance compared to ARB, in my laptop's case. But on a stronger computer, Vulkan performs a bit better. 

Link to comment
Share on other sites

19 minutes ago, Seleucids said:

With the stutter "fix", in P3 there is visible delay (between input and GUI response) as soon as the phase 3 tech finishes researching. It's almost magic. 

Frame rate wise, the counter drops from 120fps in P2 to 50-60fps. However, in reality (at least from user perspective), it is nowhere near the 50 fps claimed by the counter. Occasionally the frame rate counter does shop dips to as low as 8fps while building barracks in P3. 

Weird thing is, if I push with large army in P2, the stutter is significantly less and frame rate is high. P3 seems to be the culprit. :confused: 

Could you upload a commands.txt of a game which shows this behaviour? It's possible that there's some tech thing that leads to issues.

Link to comment
Share on other sites

22 minutes ago, Seleucids said:

Is there something special about the Linux kernel that you have noticed, or is it just a coincidence that most people replying to this thread are Linux users?

If you release cross-platform software the vast majority of feedback will come from Linux users, even if they're the minority of users. That's because Linux users are on average more tech savy and are used to debugging and opening bug reports. So that alone isn't necessarily an indicator for a Linux specific problem.

  • Like 1
Link to comment
Share on other sites

18 minutes ago, wraitii said:

Could you upload a commands.txt of a game which shows this behaviour? It's possible that there's some tech thing that leads to issues.

commands.txt

This is a 4v4 where I suicided due to lag. Hakuna was pinging me to retreat but I couldn't, because the GUI was almost frozen. The counter claimed 8 fps but it was more like 0.8 fps. Within 1 frame update, my pop dropped from 200 to 173. The next frame I saw I was at 130. All I did was order a retreat. 

 

This one is me attempting a 1v7 challenge against AIs:

commands.txt

Edited by Seleucids
Link to comment
Share on other sites

2 hours ago, Seleucids said:

commands.txt 1.48 MB · 1 download

This is a 4v4 where I suicided due to lag. Hakuna was pinging me to retreat but I couldn't, because the GUI was almost frozen. The counter claimed 8 fps but it was more like 0.8 fps. Within 1 frame update, my pop dropped from 200 to 173. The next frame I saw I was at 130. All I did was order a retreat. 

Replaying this - I don't see an obvious point where lag shows up, it's just slowly slower over time.

Capture d’écran 2025-02-20 à 14.07.34.png

There are big lag-spikes from the full hashes - they take about 150ms on my machine and I have a very powerful computer. The biggest lag spikes are GC slices, which take around 350ms on my machine.

Regular sim turns take about 30ms, so on slower computers that's a lot of lag.

---

I suspect the phase 3 lag might actually be from the GUI update, which I won't see by just replaying.

  • Like 1
Link to comment
Share on other sites

4 hours ago, Seleucids said:

Is there something special about the Linux kernel that you have noticed, or is it just a coincidence that most people replying to this thread are Linux users?

No, its just an observation I made that the 4 linux players also report worse performance in addition to the stutter. I think there needs to be an a26-a27 profile comparison to put this suspicion to rest.

  • Like 1
Link to comment
Share on other sites

6 minutes ago, Seleucids said:
22 minutes ago, real_tabasco_sauce said:

a26-a27 profile comparison to put this suspicion to rest.

Question: how can i compile A26 on Linux? There are many errors

Well I am linux naive, so I can't help much. But downloads are here https://releases.wildfiregames.com/. Maybe you could try  @andy5995's appimage? https://github.com/0ad-matters/0ad-appimage/releases

its on that page if you scroll.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Another observation: some civs lag and stutter more than others in P3 and when fighting. 

  • Unplayable stutter: Athenians, Romans
  • Very Lag: Spartan, Seleucid, Carthaginians, Macedonians
  • OK: Gaul, Britons, Persians
  • Least lag: Ptolemies, Mauryas, Kushites, Han

Unit type also matters: in general, skirmishers lag much more than slingers and archers. Pikes lag less than spears or swords. Cavalry units also follow the same pattern, but will stutter completely if you try to retreat them. 

Link to comment
Share on other sites

23 hours ago, Seleucids said:

Question: how can i compile A26 on Linux? There are many errors

This can give you an idea of what has changed
https://gitlab.archlinux.org/archlinux/packaging/packages/0ad/-/commits/main
 

But your best bet is with
https://mynixos.com/nixpkgs/package/zeroadPackages.zeroad-unwrapped
https://github.com/NixOS/nixpkgs/blob/88a55dffa4d44d294c74c298daf75824dc0aafb5/pkgs/games/0ad/game.nix#L187

Link to comment
Share on other sites

I tried playing another 4v4 in a27 and looked at the profiler;
For me, the culprits seem to be "sim update" and "gui sim update", which both took over 200msec/frame in lategame, surprisingly enough without any real correlation to what was going on "on the battlefield", so even while we weren't fighting at all.
"Render" is at 37 msec/frame, which isnt optimal, but could get me 25fps, which would not be a problem at all.
"State hash check" is at ~20, which is noticable, but also not nearly as bad as "sim update".

I'm playing on Ubuntu 24.04 and I installed 0ad by downloading the "build" and "data" from https://gitea.wildfiregames.com/0ad/0ad/releases and then following Atriks instructions here:

Someone informed me that I could try installing it with an AppImage? But I don't think that should make a difference? I'm not very well versed in those things, I'm sorry. 
Is the profile.txt correct? Or is that profiler1? How do I swap to profiler2?

I also tried testing in a26, but since I cant really play 4v4 alone, I had to play with 7 bots... but they dont even reach 200pop since they kill each other first... still, in this test game I got to 300pop without any significant lags (sim update took 100msec/frame at most, and only when there was a lot going on, mostly 40-60msec/frame)

Edit: After playing a bit more, the sim updates actually went up to 140msec/frame. Considering that there are be less units here than in a proper 4v4, the sim update might not be very different regarding time consumption. But the "gui sim update" in a26 never exceeded 30msec/frame!

profile.txt profileA26.txt

Edited by TheCJ
  • Thanks 1
Link to comment
Share on other sites

17 minutes ago, TheCJ said:

"State hash check" is at ~20, which is noticable, but also not nearly as bad as "sim update".

My understanding is that the f11 profiler uses some averaging, like a sliding window average. For me, hash checks in the f11 profile that get as high as 15 or so MS correspond to profiler2 peaks (gaps in a non-visual replay) as big as 130 -150 MS.

22 minutes ago, TheCJ said:

I tried playing another 4v4 in a27 and looked at the profiler;
For me, the culprits seem to be "sim update" and "gui sim update", which both took over 200msec/frame in lategame, surprisingly enough without any real correlation to what was going on "on the battlefield", so even while we weren't fighting at all.

Ok this is interesting. You are also on linux right?

25 minutes ago, TheCJ said:

I also tried testing in a26, but since I cant really play 4v4 alone, I had to play with 7 bots

The bots add in some lag. What you can do to test is do alt+d, opening the developer overlay, and then check "change perspective" this allows you to do "gift from the gods" for each player and then set up some auto queues into the middle to make a large, enduring battle. 

Link to comment
Share on other sites

2 minutes ago, real_tabasco_sauce said:

Ok this is interesting. You are also on linux right?

Yes.

2 minutes ago, real_tabasco_sauce said:

The bots add in some lag. What you can do to test is do alt+d, opening the developer overlay, and then check "change perspective" this allows you to do "gift from the gods" for each player and then set up some auto queues into the middle to make a large, enduring battle. 

If the bots add lag, then the performance in a26 4v4 with players would be even better?! Huh.
Thanks for the tip, I'll try testing that aswell when I have the time!

Link to comment
Share on other sites

40 minutes ago, TheCJ said:

Someone informed me that I could try installing it with an AppImage? But I don't think that should make a difference? I'm not very well versed in those things, I'm sorry. 

A dev will answer this better, but AFAIK a natively compiled version should offer better performance than a version installed from an AppImage.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...