nocompile Posted November 2, 2010 Report Share Posted November 2, 2010 Hi. Yesterday Phillip added some code that allows us to, from the console, view the world from a selected unit. This is awsome, you have to try it. Thankyou Phillip. He also showed me how to bind commands and little scripts to keys, I bound the view-from-first-person's perspective to the key T and it worked great .Now I'm wondering if I can bind diffrent things to the W,A,S,D keys so I can control the unit directly from the first person perspective without using the mouse.I'd like to bind "move forward" to W, "move backwards" to S, and either strafe sideways or turn left/right to A and D (probably want turn as there is no mouselook (yet?)). and some key for attack (enter?) Is anyone else interested in this little modding project. It lets you lead from the front like the ancient generals of old did!An additional idea is being able to change binds in game: if you press T not only does it set your view to first person, it could also change the binds of WASD, and also make it so if you move your mouse to the edge of the screen it doesn't exit first person, but if you press say H or something, then it changes the binds back to normal camara movements for the God perspective mode.I forgot the command that changes the camera as Im not on the home computer right now, but it works great and everything looks good.Another idea that was floated is improving the collision detection to detect walls (as a mode) rather than just the model bounding box. This would allow units to walk around in a building. Simple interiors could even be added to the buildings for fun. If you need to know how to do the various diffrent collision detection algorithims, just ask divverent or Lord_Havok on quakenet irc as xonotic/nexuiz/darkplaces has 4 or 5 diffrent types of collision detection algorithims programmed in to choose from per-model and you could ask them what the algos are.Anyone want to work on this little feature/mod? It's awsome as is to look from the first person perspective, really gets you in the game, and you can command using the mouse, but adding keyboard controls would make it even better (say, via binds) 1 Quote Link to comment Share on other sites More sharing options...
oshron Posted November 2, 2010 Report Share Posted November 2, 2010 this sounds like it would be alot of fun, but i would recommend putting it lower on the list of priorities; we need to FINISH the darn game first Quote Link to comment Share on other sites More sharing options...
AuroN2 Posted November 3, 2010 Report Share Posted November 3, 2010 the problem with this is that it has been done, and when it is done, it is either crap... under developed or EXTREMEL LAGGY (rts system = bad for such things)exampls of this are... SharpShooters (map) On Warcraft III, extremely fun but EXTOREeMly laggy, so unless they develop it into the system, which they wont, this probably will not. >.> Quote Link to comment Share on other sites More sharing options...
nocompile Posted November 3, 2010 Author Report Share Posted November 3, 2010 In console ( ~ ) do, when having a unit selected:Engine.CameraFollowFPS(Engine.GetActiveGui().g_Selection.toList()[0])If you want to bind it to the letter T In: session.xml<object hotkey="camera.firstperson"> <action on="Press">Engine.CameraFollowFPS(Engine.GetActiveGui().g_Selection.toList([0]</action></object>and default config:hotkey.camera.firstperson = "T" ; First-Person view from the first unit in the selectionThe "lag" doesn't bother me.We need some controls, WASD. Quote Link to comment Share on other sites More sharing options...
plumo Posted November 3, 2010 Report Share Posted November 3, 2010 Play Rise & Fall for ideas on how to implement an "FPS" mode.About interiors: I think units sizes / building sizes will need to be reworked in order to have 'exact' proportions... Otherwise units get stuck in the ceiling of a house, or the walls are not wide enough etc...Alltogether i'm not a big fan of this mode, but i'm sure others are. Quote Link to comment Share on other sites More sharing options...
DGMurdockIII Posted November 4, 2010 Report Share Posted November 4, 2010 would be cool if you could do this Quote Link to comment Share on other sites More sharing options...
KaosKeith Posted November 5, 2010 Report Share Posted November 5, 2010 i remember dungeon keeper had something like this a looooong time ago, it was really usefull because you weren't able to get units to move into undiscovered areas Quote Link to comment Share on other sites More sharing options...
nocompile Posted November 6, 2010 Author Report Share Posted November 6, 2010 Here are some screenshots taken from that camera view.All we need now is a few more camera control commands:pan(direction,speed,panlimit) [[panlimit in degrees]if panlimit not set, then it's assumed to be unlimited] and stoppan[for when you release the key you bound pan(left,2) pan(right,2) pan(up,2,90) pan(down,2,90) to.Also I took the unused buildings and made the following by editing and adding xml files:unit_woman can now create: schoolschool creates: stonemasonstonemason builds at 1.6x the rate of regular and builds (among other regular things): academyacademy builds: architect, artistarchitect builds at 1.3x the rate of regular and builds: academy, stoa, royal stoa, meeting hallmeeting hall builds: diplomatdiplomat builds: mecenary towermerc_tower builds: various foreign soliders (expensive though)artist builds: doric column, small statue of aphrodite, large statue of aprodite, plants cyprus tree and plants lombard popolar trees for 10 more wood than they produce.I also did some additions to the celts.They can now build homesteads which go up in 1/3rd the time of a civic center, but cost more since the construction is not as careful (think building a causeway vs a suspention bridge: the suspention brige takes less tons of materials vs the causeway which is dumped fill, but takes longer to build as it is more exacting), and only build woman and spearman (not the other 3 men the civic center builds). This way the celts have a fighting change against the hellens, they can build towns quicker and spread out eveywhere.The celt woman can also now build taverns, longhouses, and fences (wooden) for quick blocking of enemy. The taverns can train a really good chariot to counter the hellens mecenary units.Ofcourse, Mythos Ruler told me before that he would never allow me to contribute to the game, and he and Philip have said that they would NEVER implement additional camera and simple direct movement commands that would allow a player to command from the FRONT (like real generals of old did), even though it would be quite simple to allow these functions to be accessed by the bind system (and that's all I'm asking for, then we could make our own binds to get first person usable and enjoyable to look around in). They say this is a RTS game only and they WILL NOT add even simple code to allow us, who mod, to do firstperson stuff. That is a darn shame. It wouldn't be hard for people in the know, like they are, to just ALLOW us to do this. Quote Link to comment Share on other sites More sharing options...
Ykkrosh Posted November 6, 2010 Report Share Posted November 6, 2010 (Nobody's disallowed from doing anything - the technical problem is that non-rubbish first-person control is incompatible with the engine's design (it would have terrible lag, coarse collision detection, etc, as well as the poor texture quality and rendering performance) since it was designed as a top-down RTS engine, and I'm not very interested in working on inevitably-poor features when there's plenty of other things to be working on instead. Also nobody's going to be strongly motivated by someone who spends half their time on IRC demanding that people implement their pet features and the other half insulting them.) Quote Link to comment Share on other sites More sharing options...
SMST Posted November 6, 2010 Report Share Posted November 6, 2010 (edited) Sidenote on the screen: Greek Chi (χ) transliterates to "ch", not "x". So, αρχιτέκτων -> architékton. Which would be the proper form, instead of architektonas. (which is accusative plural form)For the usefulness of the feature:Well ... I don't think it is needed. If 0 A.D. were to go there, the graphics had to look good in both 1st and 3rd person view and it would surely causing lags, as in Rise&Fall.Edit:I noticed the terrible spelling of "Akhadhmia". Seriously, what source do you guys have? Edited November 6, 2010 by SMST Quote Link to comment Share on other sites More sharing options...
nocompile Posted November 6, 2010 Author Report Share Posted November 6, 2010 You can control the unit from the first person using the mouse, just can't pan the camera. There is no noticible "lag". You can suggest that there would be but the truth of the matter is there is none. Also about "performance issues": you can see WAY more from RTS view than you can see from firstperson, atleast 4x more from RTS view. All I am asking for is a command to pan the camera. Not bound to any key or "official", I can bind it myself. I'd also like a command to directly move the unit rather than relying on the slow pathfinding routienes.First person looks good to me, and it can stay a mod... but I need the TOOLS to make the mod. Just a few more commands revealed to the bind system.If you want to attach the camera to a unit in first person, Philip gratiously created this command, open console to do it ( ~ ):Engine.CameraFollowFPS(Engine.GetActiveGui().g_Selection.toList()[0])I, myself, don't know of any way to pan the camera from the console. If there is a way please tell me. If there isn't I'm asking for a pan command, that's all. I've looked in the wiki and can't find anything.Why do I insult on the IRC? Well the first day Mythos Ruler told me I wasn't allowed to contribute, ever. Period.Secondly it seems your views are totally myopic where you won't even reveal whatever routienes are needed to pan the camera to the bind system .Cmon, that can't be hard at all, you allready clearly have commands to spin the camera around a seleted unit, why can't I have simple turn camera command?As for the greek: I used bable fish and then a greek to greeklish converter as I don't think you support unicode. Quote Link to comment Share on other sites More sharing options...
SMST Posted November 6, 2010 Report Share Posted November 6, 2010 Here you go. This is a proper dictionary and it lets you display the latin transliteration. Quote Link to comment Share on other sites More sharing options...
Mythos_Ruler Posted November 7, 2010 Report Share Posted November 7, 2010 Why do I insult on the IRC? Well the first day Mythos Ruler told me I wasn't allowed to contribute, ever. Period.You were told that after you began your insults. Nothing you've said since then, including further insults against just about every individual on the dev team, has changed our minds. Do not misrepresent the situation again.You are welcome to discuss the development of the game, to suggest features, to work on features, and to discuss ways to implement those features. You are not welcome to continue your insults against Wildfire Games members. Yes, consider yourself warned. Quote Link to comment Share on other sites More sharing options...
nocompile Posted November 7, 2010 Author Report Share Posted November 7, 2010 I talked to two or three people. How can that be insulting EVERY member of the team, individually?! Quote Link to comment Share on other sites More sharing options...
oshron Posted November 7, 2010 Report Share Posted November 7, 2010 i actually really like those on-the-ground pics; it reminds me alot of empire earthi think the player should be allowed to zoom in considerably (even if that means the textures dont look as good), but actually walking around on the ground seems to be FAR too complex for the game, especially since that isnt the focus. one of the things i liked about empire earth was being able to zoom in on the units on the ground and get right in the action. again, it made the textures look rather poor, but youll more often than not be commanding from the third-person bird's eye view because you can see more. getting right down on the ground was really good for cinematics, and, for the record, AOM skirted the problem of low-quality textures and models by not only letting the player zoom in only a bit (like in AOK) but also made it so that there were special models and textures that the game only used during cinematics, so a low-quality arkantos in normal gameplay became a detailed, epic-looking atlantean admiral in cinematics Quote Link to comment Share on other sites More sharing options...
nocompile Posted November 7, 2010 Author Report Share Posted November 7, 2010 Mythos: whatever insults I did make, don't take personally, I've found that when I ask nicely for help in opensource (say on #debian or anywhere else), I get none. When I make some noise, well that's more sucessful. This is in any opensource project I've ever used, contributed to, etc etc. This is from about 9 years of linux experiance.It's not too complex:if (m->FollowFirstPerson) { float x, z, angle; cmpPosition->GetInterpolatedPosition2D(frameOffset, x, z, angle); float height = 4.f; m->ViewCamera.m_Orientation.SetIdentity(); m->ViewCamera.m_Orientation.RotateX(M_PI/24.f); m->ViewCamera.m_Orientation.RotateY(angle); m->ViewCamera.m_Orientation.Translate(pos.X, pos.Y + height, pos.Z); m->ViewCamera.UpdateFrustum(); return; }GameView.cppOk so here we see the camera being updated (each tic) to be facing whatever angle (in PI: from 0 to 3.14...) the unit is facing. Which means we just have to add a command to change the angle of the unit and we automatically change the way the camera is facing. Now, what is harder is how to get the camera to look up/down. Ok so this means we first gotta go to input.js and selection.js (k775 gives the tip) and implement a function to change the units angle via a command, and we have to get that exported as a command for the console. Quote Link to comment Share on other sites More sharing options...
nocompile Posted November 7, 2010 Author Report Share Posted November 7, 2010 Which resides in:binaries/data/mods/public/gui/session_new/selection.jsbinaries/data/mods/public/gui/session_new/input.js Quote Link to comment Share on other sites More sharing options...
nocompile Posted November 7, 2010 Author Report Share Posted November 7, 2010 (edited) What we need to do is add a command that does this:(M_PI is the constant Pi (3.14159265...))func_ChangeUnitAngle(ScalarRotationRate) { NewAngle = M_PI + ScalarRotationRate; if (NewAngle > M_PI) { NewAngle = (NewAngle - M_PI); } Current.Selected.Entity[0].Angle(NewAngle);}Then we can do something like:Bind "R" = func_ChangeUnitAngle((M_PI/360)*20); */TurnTwenty Degrees Clockwise/*Bind "L" = func_ChangeUnitAngle(((M_PI/360)*20)*-1); */TurnTwenty DegreesCounterclockwise/*I don't know what the actual names of, say, the current seleted entity is etc though or how to access it's angle and change it.Then we need to add some command that tells the current selected entity to go forward abit. Edited November 7, 2010 by trajans_adviser Quote Link to comment Share on other sites More sharing options...
nocompile Posted November 7, 2010 Author Report Share Posted November 7, 2010 I guess Engine.GetActiveGui().g_Selection.toList()[0] gets you the 1st of the currently selected units. So how do we edit the angle variable of whatever that unit is? Engine.GetActiveGui().g_Selection.toList()[0].angle? Quote Link to comment Share on other sites More sharing options...
Jeru Posted November 7, 2010 Report Share Posted November 7, 2010 Mythos: whatever insults I did make, don't take personally, I've found that when I ask nicely for help in opensource (say on #debian or anywhere else), I get none. When I make some noise, well that's more sucessful. This is in any opensource project I've ever used, contributed to, etc etc. This is from about 9 years of linux experiance.By your own admission, you insulted team members (I have no idea what you said but I will take your word for it).I don't know what you consider "noise" but we don't respond well to insults.Maybe we're special. That's how our community works, though. Please abide by the rules from now on and everything should be fine. Quote Link to comment Share on other sites More sharing options...
nocompile Posted November 7, 2010 Author Report Share Posted November 7, 2010 Ok some new info:11:36 < trajan34> somevalue->Engine.GetActiveGui().g_Selection.toList()[0].angle11:37 < trajan34> to change that unit's angle?11:37 < evans1> Philip: The 0ad collada files contain the bone data?11:40 <@Philip`> evans1: Yes11:40 <@Philip`> trajan34: No - the selection list simply gives the ID number of the unit, not an object11:40 < trajan34> Philip`: how do I get an object?11:41 < evans1> Philip: Can I start implementing Resource Dropsites or does it depend on anything else?11:41 -!- pablo_ [webchat@190.50.200.173] has joined #0ad11:42 < pablo_> alguien juega????????????????????????11:42 -!- dispy [~dispy@188.46.133.230] has quit [Ping timeout]11:43 <@Philip`> trajan34: You can't, since the engine doesn't work like that - the GUI has to use Engine.PostNetworkCommand to send a network-synchronised message in order to update the entitySo some new information Quote Link to comment Share on other sites More sharing options...
nocompile Posted November 7, 2010 Author Report Share Posted November 7, 2010 Ok I tried, but I _cannot_ find where or how to change a units .angleI really need someone who actually knows about the engine to help.I've been chasing variables around but it's like a maze.http://pastie.org/1279466http://pastie.org/1279475http://pastie.org/1279506 Quote Link to comment Share on other sites More sharing options...
nocompile Posted November 7, 2010 Author Report Share Posted November 7, 2010 In UnitAI.js binaries/data/mods/public/simulation/components/UnitAI.jsI was able to disable the AI code by adding a return to this function: UnitAI.prototype.OnCreate = function() { return; if (this.IsFormationController()) UnitFsm.Init(this, "FORMATIONCONTROLLER.IDLE"); else UnitFsm.Init(this, "INDIVIDUAL.IDLE");};So that's the first step (ofcourse it would be an if-then in production code, this was just to find out how to turn off the AI), So now I need to find a way to directly pass commands to the unit. How does the AI do that? Quote Link to comment Share on other sites More sharing options...
Kimball Posted November 7, 2010 Report Share Posted November 7, 2010 Just in case this comes as new information to you, this button will let you add to what you've written rather than posting again:Otherwise, have a great day! Quote Link to comment Share on other sites More sharing options...
nocompile Posted November 7, 2010 Author Report Share Posted November 7, 2010 16:03 < trajan34> 15:53 <trajan34> case "walk-forward":16:03 < trajan34> 15:53 <trajan34> // print(cmd.message);16:03 < trajan34> 15:53 <trajan34> print(WALKFORWARD);16:03 < trajan34> 15:53 <trajan34> break;16:03 < trajan34> 15:53 <trajan34> 16:04 < trajan34> 16:04 < trajan34> Philip`: then I did in console16:04 < trajan34> Engine.PostNetworkCommand(walk-forward)16:04 < trajan34> and16:04 < trajan34> Engine.PostNetworkCommand("walk-forward")16:04 < trajan34> 16:04 < trajan34> ReferenceError: walk is not defined @Console:116:04 < trajan34> andPlease helpPLEASE Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.